I can tell you
Create a picture to act as the buffer
Draw everything into that (best part is you can draw whenever you want not JUST in the paint event)
Then in the Paint event draw that picture into the passed graphic
Done
[quote=332990:@Norman Palardy]I can tell you
Create a picture to act as the buffer
Draw everything into that (best part is you can draw whenever you want not JUST in the pain event)
Then in the Paint event draw that picture into the passed graphic
Done[/quote]
I’ve been working on this using declares. Using CreateCompatibleDC and CreateCompatibleBitmap and BitBlt. I’ve been trying to double buffer an entire canvas with controls on it this way. So far I haven’t got it working correctly.
I can believe you have issues getting it to work since you’d need to redirect the entire canvas drawing to a new DC.
And I’m not sure you can get that to happen.
I don’t mind declares I’ve been working with them so much lately they’ve actually helped me learn quite a bit.
Two reasons really.
I found BitBlt much better quality than DrawInto.
I was never able to get a picture to scale properly for me on window resize. It would either stretch or change in height. I may end up coming back to this for another try.
@Norman Palardy You were right I had to give up on CreateCompatibleDC and CreateCompatibleBitmap.
I finally did figure out how to create a canvas that you can stack controls on and resize the window and it never flickers again. I also wrote code that will do the same for individual controls using the same double buffering method. I’m thinking of writing a no flicker double buffer plugin for Xojo on Windows when I finish my current project.
Glad to hear you found a way to create a canvas without flicker. I would like to know If you would share the rough outline of code. I am working on a project and am getting some flickering and this would be very helpful.