{
CRect rc;
The CDC MemDC;
CBitmap MemBitmap;
GetClientRect (& amp; Rc);
CPoint scrollPt=GetScrollPosition ();
MemDC. CreateCompatibleDC (pDC);
MemDC. SetViewportOrg (- scrollPt);
MemBitmap. CreateCompatibleBitmap (pDC, rc Width (), rc, Height ());
CBitmap * pOldBitmap=MemDC. SelectObject (& amp; MemBitmap);
MemDC. FillSolidRect (scrollPt. X, scrollPt. Y, rc. The Width (), rc, Height (), RGB (0, 0));
//drawing
PDC - & gt; SetViewportOrg (0, 0);
PDC - & gt; BitBlt (0, 0, rc. Width (), rc, Height (), & amp; MemDC scrollPt. X, scrollPt. J y, SRCCOPY);
MemBitmap. DeleteObject ();
MemDC. DeleteDC ();
}
Main code as above, but call GetScrollPosition () will interrupt, comment out wouldn't, call no problem elsewhere, call other functions also won't appear the problem of interrupt CScrollView,
I want to ask next, how to solve this problem, if not solve GetScrollPosition () function to obtain the coordinates of the obtained by other functions,
CodePudding user response:
IsGetScrollPos (SB_HORZ),
GetScrollPos (SB_VERT)
CodePudding user response: