Hi there,

I'm trying to draw whole images with GDI+ and set them to CStatic or CButton via HDC. I make this, so that the drawed image is scalable, when the parent dialog is resized. I have derived a class from CStatic and in the method where I draw the image, these are the final lines:

Code:
CDC *df = this->GetDC();
HDC dci = *df;

CRect recToDraw;
this->GetWindowRect(&recToDraw);

Gdiplus::Graphics ghc(dci);
ghc.SetInterpolationMode(Gdiplus::InterpolationModeHighQualityBicubic);
ghc.DrawImage(bitmap, Gdiplus::RectF(0, 0, recToDraw.Width(), recToDraw.Height()));
This works fine, but around the controls on the dialog is still a border (see attached image, ignore the awful colors, they are for better contrast while still in development). I don't understand why it is there (window styles are disabled) and I hope, somebody got any trick for me to get rid of that border

Name:  button.png
Views: 114
Size:  3.9 KB