I need to rotate an image 90 degrees, and I figured using GDI+ would be a good way to go. However, I’m forced to work with MFC’s CImage and I’m not sure how I’d convert it to a Gdiplus::Bitmap object. I’ll also need to convert it back to a CImage after rotating it. Any ideas (or suggestions for a better way)? Good performance is important for this.
Share
You can simply use the
Bitmapconstructor that takes aHBITMAPparameter; the CImage class has a type conversion built in to provide theHBITMAP. If you’re doing the manipulation in-place then the CImage object will be automatically updated but you’ll need to let the Bitmap object go out of scope before you use it.