Re: Can't copy the background of my simple control
Looking at your CSimpleCircleDrawer::OnPaint(), you are painting what is
being displayed on the parent's DC as your background. The problem here is
that depending of the offset that you moved the control the control is most
likely displayed close to the same position that you are coping from, so you
are not going to get a clean bitmap to use as your background.
Another thing is that you are creating a bitmap selecting into the DC but
the bitmap was never created.
CDC *pDC = pParent->GetDC();
CBitmap m_Bmp; <--selecting into DC but never created!!!
CBitmap *pOldbmp = memdc.SelectObject(&m_Bmp);
"Maik Wiege" <email@example.com> wrote in message
I would recommend using Regions. Create a region that is the same shape
the icon you are trying to drag around, and set your window region to
region. That way you don't have to worry about the background.
Thanks for the tip but I really would like to know why my code is not
because I have another control that draws some lines on the screen and
there I have the same problems and regions wouldn't really help there.