-
Resizing an Image
I'd like to load an image (bmp or jpg) of unspecified size, resize it, and save it to a memory stream for display. I thought I could load it into a picture box and resize it that way but:
a) there has to be a cleaner more direct way to do this (i.e. shouldn't I be able to do this w/o loading it into a pictureBox?)
b) it looks like pictureBox holds an orginal copy of the image and gives you back that (via pictureBox.Image.Save), so this technique doesn't really seem to work anyway.
Ideas?
-
Load it into an Image. Create another Image with your desired target size. Stretch Blit the source image to the target image. Save the target Image.
-
.getthumbnail method is useful
-
Thanks guys, those are some good ideas...
-
.getthumbnail does an awful job as it will blur the whole image
-
i've used getthumbnail and it hasn't blurred the images, any more than reducing the size in photoshop etc.
-
Maybe you had small images and didn't notice..but I assure you if you try with 1024x800 pictures it will blur them up :blush:
-
http://www.vbforums.com/showthread.p...ghlight=resize
I ran into this problem a long time ago... but there is a good way to resize and even compress into jpg images properly... check out that link... and good luck :)