|
-
Aug 19th, 2013, 03:22 AM
#1
Fill image inside a rectangle (crop from center - keep aspect ratio of container)
I want an image to crop so that it will fill completely inside a rectangle when stretched.
For example, in Windows 7 & when you set wallpaper position to "Fill" then it does same thing.
I'm trying to add this feature in BackgroundImageLayout of a form or in SizeMode of a picturebox.
So, if I just find the centered crop position and crop the image with correct aspect ratio, then the form/picturebox will show that image correctly if viewing in "stretched" mode.
The solution seems to be easy, but unfortunately I couldn't think of any formula that will give me correct crop position of original image.
Any idea ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|