473,804 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1238
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******@4guysf romrolla.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******@4guys fromrolla.com> wrote in message
news:40******** ******@4guysfro mrolla.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******@4guysf romrolla.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
17483
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
2128
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 sizes are a lot bigger(in file size) than the actual image being uploaded. The actual image being uploaded was around 22000bytes The smaller resized image is 120000bytes Also on the web when the resized image is displayed it starts out with a...
3
4235
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 Karim
11
2028
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 the image but in design time mode all variables concerning Server or Context ar not set ! ...so I can't use MapPath function to obtain the physical parth of the picture ... So my second question is how to retrieve the physical root path of the...
2
1412
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: www.abc.com?handshake.jsp?userid=ettey1234&authtoken=94399843 my php page is at www.xyz.com
2
4756
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 positioning, I would like to know the gif image size. Is there a way to obtain it using Javascript or otherwise? (I know the size is indeed contained in the gif format, as I can see it with a binary editor...) Thanks! Andrew
2
4559
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 sensitive to the presence of sharply defined edges (high spatial frequency information). I have the following routine which gets the image from the camera into NewPic. I am trying to find the size in bytes of this image and I don't want to write...
3
22545
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 display (in the status bar) the image coordinates of the mouse location. However, if I use the picturebox's MouseMove event, I am getting the coordinates of the mouse over the PICTUREBOX, not the actual image underneath that (which is zoomed). i.e....
1
4255
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 assign them to products. For the product ID, I have an auto increment value for the primary key to avoid duplicate item numbers. Since I do not want to pass all of my record values to my image upload program (when I write it), I assume to just submit...
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10070
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.