I am currently updating a Windows GDI application to use Direct2D rendering, and I need to support "transparent" bitmaps using the color keyboard for backward compatibility.
I am currently working with the goal of rendering HWND and a converted WIC source file (in GUID_WICPixelFormat32bppPBGRA). My plan so far is to create an IWICBitmap from the converted bitmap, Lock (), and then process each pixel by setting its alpha value to 0 if it matches the color key.
It seems a little "brute force." Is this the best way to get close to this or is there a better way?
Edit: in the interest of completeness, here is an excerpt from what Iβve been with - it looks like it works fine, but I'm open to any improvements!
source share