旋转位图(矩形)虽然Maintining区 [英] Rotate Bitmap (Rectangle) While Maintining Area

查看:248
本文介绍了旋转位图(矩形)虽然Maintining区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能旋转的位图的度的给定数量,同时保持原有的位图的区域。也就是说,我旋转宽度的位图:100,高度:200,我的最终结果将是一个更大的图像,但旋转部分仍将有100 * 200

How can I rotate an Bitmap a given number of degrees while maintaining the area of the original bitmap. ie, what I rotate a bitmap of Width:100,Height:200, my end result will be a bigger image but the rotated portion will still have an area of 100*200

推荐答案

图形变换函数是为这个完美的。创建你想要的大小的新位图,创建一个图形对象基于关闭该位图,应用转换再画到画布(graphics.drawimage(original_image))。

The graphics transform function is perfect for this. Create a new bitmap of the size you want, create a graphics object based off that bitmap, apply the transform then draw onto the canvas (graphics.drawimage(original_image)).

下面是一个的好多例子比我能在这个时候给。

Here is a much better example than I can give at this time.

Bobpowell.net 是一个网站,我通常参考回到上变换伟大的解释。

And Bobpowell.net is a site I usually reference back to for great explanations on transforms.

这篇关于旋转位图(矩形)虽然Maintining区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆