C# 图像旋转
在asp.net中旋转图像的最佳方法是什么
我确实使用了matrix.rotateAt,但我无法让它工作,所以请告诉我最好的方法是什么?
我应该写出讨厌用图像对象旋转图像。
What is the best way to rotate a image in asp.net
I did use matrix.rotateAt but i can't get it to work so please tell me what is the best way?
I should write out that hate to rotate a image with the image object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://msdn.microsoft.com/en-us /library/system.drawing.image.rotateflip.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image.rotateflip.aspx
这是一些示例代码(不是我写的 - 前段时间发现的 这里 )这对我有用,只要你编辑一些细节。
请注意,这可能无法“开箱即用” - 新位图存在一些问题。当您旋转它时,它可能不太适合旧位图的矩形(矩形边界 b.Width、B.Height)。
无论如何,这只是为了给您一个想法。如果您选择这样做,我相信您能够解决所有细节。我会发布我的最终代码,但是我现在没有它......
Here is some sample code (not written by me - found some time ago here ) that worked for me, as long as you edit some details.
Please note, that this may not work "out of the box" - there are some issues with the new bitmap. When you rotate it, it may not fit comfortably in the rectangle of the old bitmap (rectangle bounds b.Width, B.Height).
Anyway this is just to give you an idea. If you choose to do it this way, I'm sure you will be able to work out all the details. I'd post my final code, however I don't have it on me right now...
我建议这是最好的方法
了解更多
I would suggest this is the best way
for more