Question : Looking for a transparent-background-pic<wbr />ture-contr<wbr />ol for MFC

All of the solutions I have found so far are image based - pass them a bitmap handle, trasparent color and a DC and it's drawn OK.  But I already put my images on the dialog with the resource editor, now I want them to be drawn without transparent color.

I guess I am looking for a CStatic derived class that handles tranparency. Couldn't find any.
Thanks for your help.

Answer : Looking for a transparent-background-pic<wbr />ture-contr<wbr />ol for MFC

So what is the question?

You asked if a "transparent" CStatic exists? I've answered - no. Not in MFC.
Because such control is a window. It is possible to make a window shape exactly as an image drawn in it. But it looks ugly.

Any window has a brush that cleans the background. If this brush will be NULL, the window will be transparent. But you will have a problem with the parent window. It is also a way, but we need to know more about the entire task to recommend something more specific.

I've said, in such case, it is better to draw the image in the dialog. If you want it can be a "control" - it will have the same methods as its MFC brother. If you have few images like that, it makes sense to get complicated and develop this control.

I'm going to leave this thread exactly at this point.

Happy New Year!
Random Solutions  
 
programming4us programming4us