image manipulation in vb.net
Posted on 2006-05-25
I need to get an image (jpeg or gif) resize it and then save it as a jpeg
I have seen various ways to do this on the internet and I have a few questions...
Most of the methods i have seen involve creating a bitmap object based on the original file and then manipulating it.
Can i create a bitmap object from both gif and jepg?
Can i save a bitmap as both a gif and a jpeg?
How can i tell the file that I am resizing is actaully a valid jpg or gif or not something that has been wrongly named or something?
Also, how can i best maintain the image quality. I need to maintain the aspect ratio best as possible. Most examples i have seen let you specify the height and the width of the new image and then resize. I was thinking I could specify a maximum height and a maximum width and resize the image as best as possible within those maximum values.
Any advice much appreciated.
Thanks a lot