Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Resizing the image


Message #1 by "Tom Brzeski" <tom.brzeski@o...> on Mon, 23 Jul 2001 14:47:54
I am trying to resize image which is uploded to the server. I am using 

GetThumbnailImage

of  System.Drawing.Image

               resizedImage = ImageUpload.GetThumbnailImage(300, CInt(300 

* lngHeight / lngWidth), Nothing, IntX)

                resizedImage.Save(AppPath + "_Pictures\" + sFile, 

ImageFormat.JPEG)



The new resized image is very poor quality.

Anyone know how to set JPG quality?

Please help

Message #2 by Wim Hollebrandse <Wim.Hollebrandse@c...> on Mon, 23 Jul 2001 15:15:10 +0100
GetThumbNail image uses the embedded thumbnail in the JPG file (some 

JPG

files have these thumbnails, some don't), which is likely to be much 

less

than 300 pixels wide by 300*x high - in which case you are in effect

oversizing your thumbnail.



The best thing to do is to create a New Bitmap image, and use this 

Bitmap

constructor which will resize you original image:



Dim thumb As Bitmap =3D New Bitmap(ImageUpload,New

Size(300,CInt(300*lngHeight/lngWidth)))



thumb.Save(AppPath + "_Pictures\" + sFile,ImageFormat.Jpeg)



Hope this helps,

Wim



-----Original Message-----

From: Tom Brzeski [mailto:tom.brzeski@o...]

Sent: 23 July 2001 15:48

To: ASP+

Subject: [aspx] Resizing the image





I am trying to resize image which is uploded to the server. I am using

GetThumbnailImage

of  System.Drawing.Image

               resizedImage =3D ImageUpload.GetThumbnailImage(300, 

CInt(300

* lngHeight / lngWidth), Nothing, IntX)

                resizedImage.Save(AppPath + "_Pictures\" + sFile,

ImageFormat.JPEG)



The new resized image is very poor quality.

Anyone know how to set JPG quality?

Please help


  Return to Index