473,379 Members | 1,283 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,379 software developers and data experts.

Image Size

Hi All,

I have created an application that allows users to upload images to
their listed events. When a user views their event their uploaded
image is also displayed.

However does anyone know if it is possible to resize the image at run
time??? As at the moment the images uploaded just get squashed and
distorted in the image control. Or alternatively is there a way to
obtain the height and width values from an image file when it is
uploaded??

Thanks in advance,

Simon

Oct 22 '07 #1
4 1450
On Oct 22, 10:54 am, si_owen <s.o...@sstaffs.gov.ukwrote:
Hi All,

I have created an application that allows users to upload images to
their listed events. When a user views their event their uploaded
image is also displayed.

However does anyone know if it is possible to resize the image at run
time??? As at the moment the images uploaded just get squashed and
distorted in the image control. Or alternatively is there a way to
obtain the height and width values from an image file when it is
uploaded??

Thanks in advance,

Simon
Are you using a PictureBox control to display the image? If so, what
is the value for the SizeMode property? If you set it to Zoom, the
image displayed in the picture box will be adjusted to fill out the
picturebox while maintaining the image's original aspect ratio.

Oct 22 '07 #2
Generally you may create a new bitmap then read the image file content into
the bitmap and then check the Height and the Width members
"si_owen" <s.****@sstaffs.gov.ukwrote in message
news:11**********************@e34g2000pro.googlegr oups.com...
Hi All,

I have created an application that allows users to upload images to
their listed events. When a user views their event their uploaded
image is also displayed.

However does anyone know if it is possible to resize the image at run
time??? As at the moment the images uploaded just get squashed and
distorted in the image control. Or alternatively is there a way to
obtain the height and width values from an image file when it is
uploaded??

Thanks in advance,

Simon

Oct 22 '07 #3
Guys,

I am using Visual Studio 2003, and my project is a web application. So
I cant use picturebox as this is limited to win forms.

Any other sugggestions?

Cheers,

Simon

Oct 23 '07 #4
On Oct 23, 3:53 am, si_owen <s.o...@sstaffs.gov.ukwrote:
Guys,

I am using Visual Studio 2003, and my project is a web application. So
I cant use picturebox as this is limited to win forms.

Any other sugggestions?

Cheers,

Simon
You can still use the System.Drawing members to read the width and
height values of the uploaded image. Then to resize it, you just need
to draw the image onto a new image object that is the proper size. As
with most GDI+ topics, Bob Powell has a sample on his site that does a
high quality resize. This is actually the link for generating a
thumbnail, but it seems to do a terrific job. You can browse his other
topics for a few more samples.

http://www.bobpowell.net/highqualitythumb.htm

Thanks,

Seth Rowe
Oct 23 '07 #5

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

Similar topics

4
by: Ruby Tuesday | last post by:
I have a section(185pixelsx 185pixels) in my web page to display an image that is stored in a directory. Using php, how do you resize so if: the image dimension is smaller(width and height is...
3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
4
by: no-spam | last post by:
Hello, I have an HTML question that I'm not sure can be solved. I want to restrict the maximum size of an inline image. For example, I can force the image to be 200x200 if I do this: <img...
8
by: Chris Dewin | last post by:
Hi. I run a website for my band, and the other guys want an image gallery. I'm thinking it would be nice and easy, if we could just upload a jpg into a dir called "gallery/". When the client...
1
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks-...
6
by: nichughes | last post by:
Hello all, A question relating to http://www.entrust-systems.net/ Just for a change I have run into a problem that seems to be OS specific rather than browser specific - the box image that is...
3
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
2
by: Adam Teale | last post by:
hey guys Is there a builtin/standard install method in python for retrieving or finding out an image's dimensions? A quick google found me this:...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
2
by: studentofknowledge | last post by:
For some unknown reason ie is placing images I have in a div in a weird way. One image is overlapping another but this problem is not occuring in mozilla. I have looked at my code over and over again...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.