I have continue to find handling WM_PAINT for my application a challenge.
I repaint by copying from a memory compartible DC to window DC using BitBlt a follows.
case WMN_PAINT:
hdc = BeginPaint(hWnd,&ps);
BitBlt(hdc,ps.rcPaint.left,ps.rcPaint.top,
ps.rcPaint.right-ps.rcPaint.left,
ps.rcPaint.bottom - ps.rcPaint.top,memDC,ps.rcPaint.left, + iHpos, ps.rcPaint + iVpos,SRCCOPY);
EndPaint(hWnd,&ps);
where memDC - memmory compartible DC,
iHpos = Hprizontal; scroll position, iVpos - verticical scroll position
I write from a buffer to the memeory DC memDC and allow the system to copy from the memDC to window.
The big problem is that once iVpos and iHpos exceed the size of the memory DC proper display collpses.
I can handle repaint for text only or bitmap only well, but once it is a mixture of text and bitmap rendered on a DC i9n unpredictable manner I end up using this memory DC approach.
My buffer is organised in a manner similar to this
class Buffer
{
vector<int> iPageCount;
vector<int> icharCount;
vector<tchar> chChar;
vector<int> icharXpos;
vector<int> icharYPos;
vector<int> iImageCount;
vector<string> sImagePath;
vector<int> iImageXpos;
vector<int> iImageYpos;
};
I attempted to do a page by page rendering but the same problem was faces. how do I tackle this issue of memmory DC limit exeeding problem.
How does internet explorer, MS word amd others handle repainting from the view point of scrolling.
The problem is a problem of repaint, scrolling and memory DC.
Please, how do I solve this problem
I really don't know that the above method is called double bufferig. I use only one memory DC. What really is the double buffering? How is it used?
Someone said how can use SetWindowOrg to solve this problem, how is it done?