I just finished an app that has one canvas and 2 images on it. One of the images moves around the screen when the user presses the arrows on the keyboard or uses the mouse to drag.
The canvas uses the paint event to draw the pictures. On my mac it works wonderfully but on windows it just flickers. I used the GDI+ and even tried without it. Flickering is just horrendous.
This is the code that draws the picture
g.DrawPicture(LocalPic2,ImageX,ImageY,ImageW,ImageH,0,0,LocalPic2.Width,LocalPic2.Height)
I need to eliminate the flickering. Any ideas?
Make sure there are no overlapping controls on the canvas.
Set doublebuffered = true
Set EraseBackground = false
Make sure any calls to Refresh have a false passed in to prevent the erase. Refresh(false)
Make sure any calls to Invalidate have a false passed in to prevent the erase. Invalidate(false)
Thanks for your advice. Actually the double buffer was part of the answer.
Mr. Keeney’s suggestion of not having overlapping controls on the canvas was also key. I did not realized that I had a control overlapping… Thanks to both now my app is working… mostly.