简体   繁体   中英

Flip bitmap in .NET Compact Framework

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM