.NET Compact Framework 中的翻转位图
我有一个 Bitmap 对象,有时需要水平翻转,有时垂直翻转,有时两者都翻转。 完整的框架具有 Image.RotateFlip()
方法,这正是我所需要的。 不幸的是,像完整框架上的大多数有用功能一样,这种方法在紧凑框架上不存在。 有没有一种简单的方法可以做到这一点? 我能找到的最好的是 this,但它使用了不安全的代码,我'我想避免,它只能旋转不能翻转。
编辑:好的,我找到了一种方法来进行一些优化,我只需要进行垂直翻转。
I have a Bitmap
object that I need to sometimes flip horizontally, sometimes vertically, sometimes both. The full framework has the Image.RotateFlip()
method which is exactly what I need. Unfortunately like most useful features on the full framework, this method does not exist on the compact framework. Is there a simple way to do this? The best I could find was this, but it uses unsafe code which I'd like to avoid and it could only do rotation not flipping.
Edit: Ok, I found a way to do some optimizations where I only need to do a vertical flip.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CF 不支持它,但如果您的设备支持映像库,那么您可以 P/Invoke 至 IBasicBitmapOps::Flip。 SDF 已经将其包含在 OpenNETCF.Drawing.Imaging.ImageUtils 类。
The CF doesn't support it, but if your device supports the Imaging Library, then you can P/Invoke down to IBasicBitmapOps::Flip. The SDF already has this wrapped in the OpenNETCF.Drawing.Imaging.ImageUtils class.
我最近读了一篇关于此的文章。 我还没有尝试过,因为我需要 90/180/270 以外的其他旋转,但它声称是一种快速的旋转方式。
http://www.codeproject.com/KB/graphics/ImageRotationForCF.aspx
[编辑]
该死,我没读对,你已经找到了这个..抱歉。
I recently read an article about this. I haven't tried it, because i need other rotations than 90/180/270, but it claims to be a fast way to rotate.
http://www.codeproject.com/KB/graphics/ImageRotationForCF.aspx
[edit]
damn, i didn't read correctly, you already found this.. sorry.