开发者

Resizing images in Compact Framework (both bigger and smaller)

开发者 https://www.devze.com 2023-02-12 22:14 出处:网络
I\'m trying to make a zoomable image control for the CF and I read Chri开发者_运维技巧s\'s article on how to use the IImage interface to shrink big files to be displayed on the screen, but I want to a

I'm trying to make a zoomable image control for the CF and I read Chri开发者_运维技巧s's article on how to use the IImage interface to shrink big files to be displayed on the screen, but I want to also take small images (400x400 ish) and zoom them to fill the screen (either 480x480 or even 800x800). Is there a secret to doing this? Also, if the image is 800x800, how can I specify which portion of the image is going to be clipped? And finally, does anyone know if the source is available for the link that I provided?

Thanks for any help!


95% of the code in the app that you see the screenshot of is actually in that blog entry text. There wasn't much to it. The only thing missing is teh designer-generated code for the button and two picture boxes.

Stretching an image is very easy. Just use the Graphics.DrawImage to draw the smaller source into the larger destination and the framework will do the stretch for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消