CStatic Drawing
-
Hi, I am having some problems with drawing a transparent bitmap into a CStatic derived object. I am drawing inside the OnPaint handler using Graphics ( GDI+ ) object. Since Its a transparent image, the first time when the control is drawn, I am getting the image properly. From next time onwards, when OnPaint in invoked, I am getting a black border for the image, which becomes thicker and thicker as the OnPaint in invoked ( I have to call Invalidate in Mouse over). Graphic object is attached to a Bitmap object and thats Bitmap object is used to draw to the CDC using DrawImage function. when I saved that Bitmap to a file, the image looks alright. So I guess its the DC of the CStatic control which is crating the problem. Also this CStatic control is placed in CDialog, and whenever, the dialog is minimized and restored, the image will be rendered correctly. I would appreciate any help on this behaviour. Looking forward for an answer Thanks Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."