What if you reduce the timer from 40ms to 20 or 25ms ?
40 ms will give 25fps speed, but if your drawing takes some time, then 25 fps wont be acheivable, which is why you might be facing flickering.
If that doesnt work, try caching the drawing a image on timeout, and in paint() simply draw from that cache..
Bookmarks