简体   繁体   中英

How can I rotate and make the image semitransparent at the same time by using ATL::CImage?

I just started using ATL::CImage in my MFC project, and this is very basic question about it. I know ATL::CImage members support AlphaBlend() for controlling the transparency, and plgblt() for rotating. But they are all the independent functions for only "Displaying" on DC as I understand. How Can I apply both transparency and rotation of the image and display/save it?

I know GDI+ supports everything what I want, but I wanna know how to realize them with CImage class members too.

Thank you.

This isn't possible in the same way. You can use a temporary DC for each operation.

  1. Create a DC with a bitmap of the needed size.
  2. Perform the operation of the CImage into the DC.
  3. Get the Bitmap from the DC and form a new CImage or simply work on with the DC.

The better way is always to use GDI+ to perform such operations. CImage is only needed when you need to store the interim result, or need to reuse it.

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