473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Getting Size of an Image?

Hello

I need help with some ASP.net programming. I have a web page that basically
just has the following web components: dropdownlist, listbox and image.

I am using VB.net with a CodeBehind file to read the contents of a directory
into the dropdownlist. Then when the user picks one, it displays a list of
the images in that dir in the listbox. Then when you pick a filename from
the listbox, it displays the image.

It all works, but I would like to do is if the image is bigger then 500
pixels in width, I would like it to scale the image accordingly to max out
at 500.

The part I am having trouble is getting the size of the image to check it.
Can anyone help?
Nov 18 '05 #1
2 1221
Brett Baisley wrote:
I need help with some ASP.net programming. I have a web page that basically
just has the following web components: dropdownlist, listbox and image.

It all works, but I would like to do is if the image is bigger then 500
pixels in width, I would like it to scale the image accordingly to max out
at 500.


Brett, check out this article:

Displaying a List of Scaled Images
http://aspnet.4guysfromrolla.com/articles/011503-1.aspx

The article shows how to dynamically determine an image's height & width
in pixels.

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
Nov 18 '05 #2
Hey, that helped a lot. Thanks!

"Scott Mitchell [MVP]" <mi******@4guysfromrolla.com> wrote in message
news:40**************@4guysfromrolla.com...
Brett Baisley wrote:
I need help with some ASP.net programming. I have a web page that basically just has the following web components: dropdownlist, listbox and image.

It all works, but I would like to do is if the image is bigger then 500
pixels in width, I would like it to scale the image accordingly to max out at 500.


Brett, check out this article:

Displaying a List of Scaled Images
http://aspnet.4guysfromrolla.com/articles/011503-1.aspx

The article shows how to dynamically determine an image's height & width
in pixels.

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
1
by: Ron Vecchi | last post by:
I am using asp.net to upload an image and then perform resizing on it and saving the different sizes to file. The resized images were coming up and being displayed in the bowser fine but the image...
3
by: karimL | last post by:
Hi, how can I retrieve the height and width of a System.Web.UI.WebControls.Image after populating it's ImageUrl property. It's seems not to be filled ? Does someone have a solution ? Thanks...
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
2
by: sharma | last post by:
Hi, I Have a page which will take authentication from a diffrent page from a difrent website. My program needs to call a page like this from php page lets say:...
2
by: abrtlt | last post by:
I am using Ajax with a PHP script to obtain the name of gif files from a MySQL database. Javascript then embeds the actual file in the web page, thus displaying the image on the fly. For precise...
2
by: Jerry Spence1 | last post by:
I am trying to come up with a focussing routine for a camera and I need to detect when the image is in focus. As I understand it, JPG Image size goes up sharply when it is in focus as it is very...
3
by: Andrzej | last post by:
I have a picturebox on my C# .NET form. The picturebox size mode is set to zoom. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
1
AaronL
by: AaronL | last post by:
Hello, First I would like to say thank you all for your help in the past. I am stumped again. I am creating an e-commerce system and I want to be able to upload images to the server and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.