Sezna
Mar 1st, 2001, 11:30 PM
I decided to make a thumbnailer as my VB learning project, add HTML skillz to that and it comes out pretty good. I am stuck however, on a fairly simple task - resizing a bitmap. There is a gazillion ways of doing this of course, but I can't use one properly. I first tried to use PictureClip and it worked, but the quality was horrible. Now I switched to PaintPicture, which works well but I can't get the output size right.
I load an image into the source picture box, then scale the image to the desired, say, height, and then scale the width accordingly (or the other way), and everything is perfect. When I analize the final height and width variables, they are what they should be, but when I do
picDest.PaintPicture picSrc.Picture, 0, 0, PicHeight, PicWidth
The resulting image dimensions are different from PicHeight and PicWidth (usually smaller)
Any way I can fix that? Or is there another way, without using two pic boxes and their huge overhead?
Thanks
I load an image into the source picture box, then scale the image to the desired, say, height, and then scale the width accordingly (or the other way), and everything is perfect. When I analize the final height and width variables, they are what they should be, but when I do
picDest.PaintPicture picSrc.Picture, 0, 0, PicHeight, PicWidth
The resulting image dimensions are different from PicHeight and PicWidth (usually smaller)
Any way I can fix that? Or is there another way, without using two pic boxes and their huge overhead?
Thanks