CRgn regRound;
regRound.CreateEllipticRgn(0,0,nMagnSize,nMagnSize);
pDC->SelectClipRgn(®Round, RGN_COPY );
pDC->BitBlt(0, 0, clientwidth, clientheight, &dcMemory,
0, 0, SRCCOPY);
//3.Draw a frame around the "lens"
pDC->Arc( CRect(1,1,nMagnSize - 2,nMagnSize - 2), CPoint(0,0), CPoint(0,0) );
pDC->Arc( CRect(2,2,nMagnSize - 3,nMagnSize - 3), CPoint(0,0), CPoint(0,0) );
/*4. Redraw all bits in "lens" window wich are outside a frame.
We have a tail after the "lens" when moving without this step.*/
//a bitmap - copy of View window bitmap
HBITMAP hOldBmp = (HBITMAP)::SelectObject(memDC.m_hDC, bmp.m_hObject);
CRgn regRect;
regRect.CreateRectRgn(0,0,nMagnSize,nMagnSize);
pDC->SelectClipRgn(®Rect, RGN_XOR );
pDC->BitBlt(0,0,nMagnSize,nMagnSize,&memDC,point.x-nMagnSize/2,point.y-nMagnSize/2, SRCCOPY);
regRound.CreateEllipticRgn(0,0,nMagnSize,nMagnSize);
pDC->SelectClipRgn(®Round, RGN_COPY );
pDC->BitBlt(0, 0, clientwidth, clientheight, &dcMemory,
0, 0, SRCCOPY);
//3.Draw a frame around the "lens"
pDC->Arc( CRect(1,1,nMagnSize - 2,nMagnSize - 2), CPoint(0,0), CPoint(0,0) );
pDC->Arc( CRect(2,2,nMagnSize - 3,nMagnSize - 3), CPoint(0,0), CPoint(0,0) );
/*4. Redraw all bits in "lens" window wich are outside a frame.
We have a tail after the "lens" when moving without this step.*/
//a bitmap - copy of View window bitmap
HBITMAP hOldBmp = (HBITMAP)::SelectObject(memDC.m_hDC, bmp.m_hObject);
CRgn regRect;
regRect.CreateRectRgn(0,0,nMagnSize,nMagnSize);
pDC->SelectClipRgn(®Rect, RGN_XOR );
pDC->BitBlt(0,0,nMagnSize,nMagnSize,&memDC,point.x-nMagnSize/2,point.y-nMagnSize/2, SRCCOPY);