简体   繁体   中英

Resize image from file to the right aspect ratio vb6

I searched about re-sizing images all over the place and they all use picturebox and Image control trying to fit an image inside it without distortion of the image.

In my case I have an image of 2048X900 of size but the image is stretched in width I need to read it from a file, repair it by changing the aspect ratio of the image, and store it back. I leaned I can't do directly on the image and some use control to do all this steps.

Any suggestion of I have to use a control to change the ratio of an image

thanks

When you choose to resize an image into a different aspect ratio than the original's, you'll need to decide how you'd like that to happen. There are various ways, like stretching (as you already mentioned), padding (resizing the image and filling the padding with whitespaces or anything else), or cropping the image (which means that you'll need to choose which parts of the images remain visible and which ones don't).

There are quite a few of ways to perform such image resizing, either locally with a software or using cloud services. For example, with Cloudinary you can upload an image and resize it to any dimensions you'd like, including altering the aspect ratio. Everything is done seamlessly on the fly and in the cloud. For more information: http://cloudinary.com/documentation/image_transformations#aspect_ratio_based_cropping

Disclosure - I work at Cloudinary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM