Connecting Tech Pros Worldwide Forums | Help | Site Map

Text below an image

Rajesh
Guest
 
Posts: n/a
#1: Jan 19 '06
Hi all,

Im gonna display a list of images in an aspx page from sql server Db.Each
image has a link.When someone clicks the image i want the width and size of
the image to be displayed at the bottom of the image without any coding at
code-behind because the resulting page will display only the image.

Rajesh



Dan
Guest
 
Posts: n/a
#2: Jan 19 '06

re: Text below an image


"i want the width and size of the image to be displayed at the bottom of the
image ..."

"...the resulting page will display only the image"

Please explain? What is it you are asking?

--
Dan
"Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi all,
>
> Im gonna display a list of images in an aspx page from sql server Db.Each
> image has a link.When someone clicks the image i want the width and size
> of
> the image to be displayed at the bottom of the image without any coding at
> code-behind because the resulting page will display only the image.
>
> Rajesh
>
>[/color]


Rajesh
Guest
 
Posts: n/a
#3: Jan 19 '06

re: Text below an image


Alright , Say we have this image link
http://www.theserverside.net/article...rovider/Creati
ngProfileProvider.gif
What do you see? Just an image right?.
In my situation the image is in the form of a binary file inside sql server
database.Now i retreive and display say 10 images.When i click an image it
goes to another page that displays the image say like the link i showed u
above.Now under this image i want to a text to be displayed showing me the
width and size of the image.
Still not clear?



"Dan" <dvazanias@aol.com> wrote in message
news:uClKNCPHGHA.140@TK2MSFTNGP12.phx.gbl...[color=blue]
> "i want the width and size of the image to be displayed at the bottom of[/color]
the[color=blue]
> image ..."
>
> "...the resulting page will display only the image"
>
> Please explain? What is it you are asking?
>
> --
> Dan
> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
> news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...[color=green]
> > Hi all,
> >
> > Im gonna display a list of images in an aspx page from sql server[/color][/color]
Db.Each[color=blue][color=green]
> > image has a link.When someone clicks the image i want the width and size
> > of
> > the image to be displayed at the bottom of the image without any coding[/color][/color]
at[color=blue][color=green]
> > code-behind because the resulting page will display only the image.
> >
> > Rajesh
> >
> >[/color]
>
>[/color]


Dan
Guest
 
Posts: n/a
#4: Jan 19 '06

re: Text below an image


So the question is.

How do you display the width/height dimensions of an image?

Wouldnt that be easier, but maybe this is due to a language barrier so i
apologise if that is the reason.

Use System.Drawing.Image class. Load your image in and then retrieve the
width/height attributes.

--
Dan
"Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
news:ewOfANPHGHA.208@tk2msftngp13.phx.gbl...[color=blue]
> Alright , Say we have this image link
> http://www.theserverside.net/article...rovider/Creati
> ngProfileProvider.gif
> What do you see? Just an image right?.
> In my situation the image is in the form of a binary file inside sql
> server
> database.Now i retreive and display say 10 images.When i click an image it
> goes to another page that displays the image say like the link i showed u
> above.Now under this image i want to a text to be displayed showing me the
> width and size of the image.
> Still not clear?
>
>
>
> "Dan" <dvazanias@aol.com> wrote in message
> news:uClKNCPHGHA.140@TK2MSFTNGP12.phx.gbl...[color=green]
>> "i want the width and size of the image to be displayed at the bottom of[/color]
> the[color=green]
>> image ..."
>>
>> "...the resulting page will display only the image"
>>
>> Please explain? What is it you are asking?
>>
>> --
>> Dan
>> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
>> news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...[color=darkred]
>> > Hi all,
>> >
>> > Im gonna display a list of images in an aspx page from sql server[/color][/color]
> Db.Each[color=green][color=darkred]
>> > image has a link.When someone clicks the image i want the width and
>> > size
>> > of
>> > the image to be displayed at the bottom of the image without any coding[/color][/color]
> at[color=green][color=darkred]
>> > code-behind because the resulting page will display only the image.
>> >
>> > Rajesh
>> >
>> >[/color]
>>
>>[/color]
>
>[/color]


Rajesh
Guest
 
Posts: n/a
#5: Jan 19 '06

re: Text below an image


Dan,
You are getting it wrong . Did you see the image link i gave??
or say you click this link
http://www.google.com/logos/Logo_25wht.gif
The width and hieght should be displayed below that image



"Dan" <dvazanias@aol.com> wrote in message
news:ucbH6TPHGHA.2040@TK2MSFTNGP14.phx.gbl...[color=blue]
> So the question is.
>
> How do you display the width/height dimensions of an image?
>
> Wouldnt that be easier, but maybe this is due to a language barrier so i
> apologise if that is the reason.
>
> Use System.Drawing.Image class. Load your image in and then retrieve the
> width/height attributes.
>
> --
> Dan
> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
> news:ewOfANPHGHA.208@tk2msftngp13.phx.gbl...[color=green]
> > Alright , Say we have this image link
> >[/color][/color]
http://www.theserverside.net/article...rovider/Creati[color=blue][color=green]
> > ngProfileProvider.gif
> > What do you see? Just an image right?.
> > In my situation the image is in the form of a binary file inside sql
> > server
> > database.Now i retreive and display say 10 images.When i click an image[/color][/color]
it[color=blue][color=green]
> > goes to another page that displays the image say like the link i showed[/color][/color]
u[color=blue][color=green]
> > above.Now under this image i want to a text to be displayed showing me[/color][/color]
the[color=blue][color=green]
> > width and size of the image.
> > Still not clear?
> >
> >
> >
> > "Dan" <dvazanias@aol.com> wrote in message
> > news:uClKNCPHGHA.140@TK2MSFTNGP12.phx.gbl...[color=darkred]
> >> "i want the width and size of the image to be displayed at the bottom[/color][/color][/color]
of[color=blue][color=green]
> > the[color=darkred]
> >> image ..."
> >>
> >> "...the resulting page will display only the image"
> >>
> >> Please explain? What is it you are asking?
> >>
> >> --
> >> Dan
> >> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
> >> news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...
> >> > Hi all,
> >> >
> >> > Im gonna display a list of images in an aspx page from sql server[/color]
> > Db.Each[color=darkred]
> >> > image has a link.When someone clicks the image i want the width and
> >> > size
> >> > of
> >> > the image to be displayed at the bottom of the image without any[/color][/color][/color]
coding[color=blue][color=green]
> > at[color=darkred]
> >> > code-behind because the resulting page will display only the image.
> >> >
> >> > Rajesh
> >> >
> >> >
> >>
> >>[/color]
> >
> >[/color]
>
>[/color]


kashyapa
Guest
 
Posts: n/a
#6: Jan 19 '06

re: Text below an image


Hi

try the following code and let me know

<html>
<head>
<script>
function CheckImageSize()
{
var imgObj = document.getElementById("img1");

document.getElementById("det").innerText = "Width : " + imgObj.width + "
Height : " + imgObj.height
}
</script>
</head>
<body onload="CheckImageSize()">
<table>
<tr>
<td>
<img id="img1"
src="http://www.theserverside.net/articles/content/CreatingProfileProvider/CreatingProfileProvider.gif" border="0">
<br>
<span id="det"></span>
</td>
</tr>
</table>
</body>
</html>



"Rajesh" wrote:
[color=blue]
> Hi all,
>
> Im gonna display a list of images in an aspx page from sql server Db.Each
> image has a link.When someone clicks the image i want the width and size of
> the image to be displayed at the bottom of the image without any coding at
> code-behind because the resulting page will display only the image.
>
> Rajesh
>
>
>[/color]
Dan
Guest
 
Posts: n/a
#7: Jan 19 '06

re: Text below an image


Hi Rajesh,

Your really not making sense so this is the last post i will try since i
cant help. Amazed the option of 'maybe i am not being clear' hasn't occurred
just that i am getting it wrong. Perhaps coder arrogance is why you can't
solve a very simple problem?

You want to write the width and height of your image when loaded from a sql
server db underneath the image.

So you have a picture and underneath its dimensions.

Now when i said you want to retrieve the image width/height i just didnt add
that you want to write them out to the screen ( i assumed this would be
obvious once you had it).

Anyway use the code i gave before and get the image from your sql server db,
load it from there into the image class.

Then use that class to give you the width and height then Response.Write it
out to the page under the image. That will give you an image and underneath
it the dimensions printed.

I am using the code behind. If you dont want to then go javascript way as
the other person posted and do it client side.

--
Dan
"Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi all,
>
> Im gonna display a list of images in an aspx page from sql server Db.Each
> image has a link.When someone clicks the image i want the width and size
> of
> the image to be displayed at the bottom of the image without any coding at
> code-behind because the resulting page will display only the image.
>
> Rajesh
>
>[/color]


Mark S. Milley, MCAD (BinarySwitch)
Guest
 
Posts: n/a
#8: Jan 19 '06

re: Text below an image


Or you could use this:

<html>
<script>
function setImgPlaceHolder(){
oDiv=document.getElementById("imgPlaceHolder");
oDiv.innerHTML=oDiv.innerHTML + '<br>' + oDiv.children[0].width + ' x
' + oDiv.children[0].height;
}
</script>
<body onload="setImgPlaceHolder();">
<div id="imgPlaceHolder" style="position:relative;text-align:center;
font-weight:bold;">
<img src="http://www.google.com/logos/Logo_25wht.gif">
</div>
</body>
</html>

KMA
Guest
 
Posts: n/a
#9: Jan 19 '06

re: Text below an image


Actually, I think he got it right. He didn't supply pastable code, but the
hint is spot on. when you come to place the link on the page, open the file
yourself (in server code, I mean; not you personally) using the class
indicated, then find out the information you want and output to your page an
additional piece of text with this information. The net result will be a
link followed by the text showing the dimentions.



"Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
news:%23RjmBaPHGHA.528@TK2MSFTNGP12.phx.gbl...[color=blue]
> Dan,
> You are getting it wrong . Did you see the image link i gave??
> or say you click this link
> http://www.google.com/logos/Logo_25wht.gif
> The width and hieght should be displayed below that image
>
>
>
> "Dan" <dvazanias@aol.com> wrote in message
> news:ucbH6TPHGHA.2040@TK2MSFTNGP14.phx.gbl...[color=green]
>> So the question is.
>>
>> How do you display the width/height dimensions of an image?
>>
>> Wouldnt that be easier, but maybe this is due to a language barrier so i
>> apologise if that is the reason.
>>
>> Use System.Drawing.Image class. Load your image in and then retrieve the
>> width/height attributes.
>>
>> --
>> Dan
>> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
>> news:ewOfANPHGHA.208@tk2msftngp13.phx.gbl...[color=darkred]
>> > Alright , Say we have this image link
>> >[/color][/color]
> http://www.theserverside.net/article...rovider/Creati[color=green][color=darkred]
>> > ngProfileProvider.gif
>> > What do you see? Just an image right?.
>> > In my situation the image is in the form of a binary file inside sql
>> > server
>> > database.Now i retreive and display say 10 images.When i click an image[/color][/color]
> it[color=green][color=darkred]
>> > goes to another page that displays the image say like the link i showed[/color][/color]
> u[color=green][color=darkred]
>> > above.Now under this image i want to a text to be displayed showing me[/color][/color]
> the[color=green][color=darkred]
>> > width and size of the image.
>> > Still not clear?
>> >
>> >
>> >
>> > "Dan" <dvazanias@aol.com> wrote in message
>> > news:uClKNCPHGHA.140@TK2MSFTNGP12.phx.gbl...
>> >> "i want the width and size of the image to be displayed at the bottom[/color][/color]
> of[color=green][color=darkred]
>> > the
>> >> image ..."
>> >>
>> >> "...the resulting page will display only the image"
>> >>
>> >> Please explain? What is it you are asking?
>> >>
>> >> --
>> >> Dan
>> >> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
>> >> news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...
>> >> > Hi all,
>> >> >
>> >> > Im gonna display a list of images in an aspx page from sql server
>> > Db.Each
>> >> > image has a link.When someone clicks the image i want the width and
>> >> > size
>> >> > of
>> >> > the image to be displayed at the bottom of the image without any[/color][/color]
> coding[color=green][color=darkred]
>> > at
>> >> > code-behind because the resulting page will display only the image.
>> >> >
>> >> > Rajesh
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >[/color]
>>
>>[/color]
>
>[/color]


Rajesh
Guest
 
Posts: n/a
#10: Jan 19 '06

re: Text below an image


Dan,

Thanks for everything but this is what they asked me in an interview from
Microsoft thats the reason why i couldnt paste any code out here for you
guys to know what im asking.

Raj

"Dan" <dvazanias@aol.com> wrote in message
news:ewvj7lQHGHA.2212@TK2MSFTNGP15.phx.gbl...[color=blue]
> Hi Rajesh,
>
> Your really not making sense so this is the last post i will try since i
> cant help. Amazed the option of 'maybe i am not being clear' hasn't
> occurred just that i am getting it wrong. Perhaps coder arrogance is why
> you can't solve a very simple problem?
>
> You want to write the width and height of your image when loaded from a
> sql server db underneath the image.
>
> So you have a picture and underneath its dimensions.
>
> Now when i said you want to retrieve the image width/height i just didnt
> add that you want to write them out to the screen ( i assumed this would
> be obvious once you had it).
>
> Anyway use the code i gave before and get the image from your sql server
> db, load it from there into the image class.
>
> Then use that class to give you the width and height then Response.Write
> it out to the page under the image. That will give you an image and
> underneath it the dimensions printed.
>
> I am using the code behind. If you dont want to then go javascript way as
> the other person posted and do it client side.
>
> --
> Dan
> "Rajesh" <bhagarathi.rajesh@tenth-planet.com> wrote in message
> news:eYeHr7OHGHA.1332@TK2MSFTNGP10.phx.gbl...[color=green]
>> Hi all,
>>
>> Im gonna display a list of images in an aspx page from sql server Db.Each
>> image has a link.When someone clicks the image i want the width and size
>> of
>> the image to be displayed at the bottom of the image without any coding
>> at
>> code-behind because the resulting page will display only the image.
>>
>> Rajesh
>>
>>[/color]
>
>[/color]


Closed Thread


Similar ASP.NET bytes