Click here to Skip to main content
15,608,404 members

Comments by 11917640 Member (Top 92 by date)

11917640 Member 22-Feb-23 2:47am View    
And the last thing, I can think about. I would try to divide this algorithm to the high level (how to draw the screen, when I don't have enough memory to do this with one bitmap), and low level (dirty implementation details). Your render function seems to work on both levels, and looks [a bit] complicated.
11917640 Member 22-Feb-23 2:31am View    
So, how can you redraw the whole screen? Probably, by divining it by subrectangles, that you can draw at once. For each subrectangle, you need to draw background, then ask every control, that intersrcts with this subrectangle, to draw itself. Makes sense? Maybe, this way can produce better rendering algorithm?
11917640 Member 22-Feb-23 2:28am View    
Probably, you need the function like InvalidateRect, which invalidates some part of the screen, or the whole screen. During rendering, invalidated area must be redrawn, first background, then controls. Control needs to know, how to draw itself with some offset, probably including the situation, when some part of the control is out of destination bitmap.
11917640 Member 22-Feb-23 2:25am View    
Maybe you need to make one step back and think about the whole algorithm again? I understand, that you can render the screen using bitmaps, when bitmap size is less that screen size. Right? You also have some list of controls, hopefully, sorted by z-order. There is also screen background, that needs (or not?) be redrawn.
11917640 Member 8-Dec-22 3:54am View    
For rectangle ROI. Fast solution: using DrawFocusRect API. For full solution, see DrawCli MFC code sample.