Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Image Height and Width

Reply
Thread Tools

Image Height and Width

 
 
Thom Little
Guest
Posts: n/a
 
      06-20-2004
I have images of varying sizes on the server and would like to display them
on an aspx. This is easy to do (of course).

imgTest.ImageUrl = "images/image01.jpg" ;

I would like to reserve the display area before the images are loaded.

How can I determine the original height and width of the image prior to it
being loaded and displayed? Is there an article on the subject that you can
point me towards?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--



 
Reply With Quote
 
 
 
 
DalePres
Guest
Posts: n/a
 
      06-20-2004
using System.Drawing;

then in the method:


Bitmap myBitmap = new Bitmap(@"c:\somepath.jpg")
Size size = myBitmap.Size;

or

Bitmap myBitmap = new Bitmap(@"c:\somepath.jpg")
int width = myBitmap.Width;
int height = myBitmap.Height;

Hope this helps,


Dale

"Thom Little" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have images of varying sizes on the server and would like to display

them
> on an aspx. This is easy to do (of course).
>
> imgTest.ImageUrl = "images/image01.jpg" ;
>
> I would like to reserve the display area before the images are loaded.
>
> How can I determine the original height and width of the image prior to it
> being loaded and displayed? Is there an article on the subject that you

can
> point me towards?
>
> --
> -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
> --
>
>
>



 
Reply With Quote
 
 
 
 
Thom Little
Guest
Posts: n/a
 
      06-20-2004
That is EXACTLY the lead I needed.

Thank you.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

"DalePres" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> using System.Drawing;
>
> then in the method:
>
>
> Bitmap myBitmap = new Bitmap(@"c:\somepath.jpg")
> Size size = myBitmap.Size;
>
> or
>
> Bitmap myBitmap = new Bitmap(@"c:\somepath.jpg")
> int width = myBitmap.Width;
> int height = myBitmap.Height;
>
> Hope this helps,
>
>
> Dale
>
> "Thom Little" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > I have images of varying sizes on the server and would like to display

> them
> > on an aspx. This is easy to do (of course).
> >
> > imgTest.ImageUrl = "images/image01.jpg" ;
> >
> > I would like to reserve the display area before the images are loaded.
> >
> > How can I determine the original height and width of the image prior to

it
> > being loaded and displayed? Is there an article on the subject that you

> can
> > point me towards?
> >
> > --
> > -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
> > --
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I change height with <col width="50" height="100">? Bernd Meier HTML 6 01-14-2008 07:25 AM
Help! Fixed width table with a 100% width image in it is assuming theimages intrinsic size, although it does shrink the image satya.komatineni@gmail.com HTML 1 12-29-2007 08:32 PM
CSS question: Using height/width at 100% with fixed-width borders/margin/padding cera HTML 1 08-18-2007 02:59 AM
CSS min-width, max-width, and min-height with display:inline Lois HTML 1 12-27-2004 03:03 AM
Re: resized image in table extends table width to original image width Sean Jorden HTML 1 08-19-2003 08:59 AM



Advertisments