I am helping a colleague with a project and am having issues with an animation example on windows. Attached is a Canvas speed test which creates filled circles and determines the frames-per-second rate. The program physically runs when both invalidate and refresh are used but.... refresh shows animation, whereas invalidate does not.
Here is the Canvas speed test program: Canvas Speed Test
Here are some instructions:
Press the 'Run Test' button will draw 100 circles, 100 times with invalidate enabled and will show the frames per second. If the number of circles are 50, then circles with a diameter of 1, 2, 3, ....50 are drawn. If 100 circles are drawn then circles will be drawn with a diameter of 1, 2, 3, ...99, 100. The more cirlces drawn then the more time needed for drawing because the ball size is larger.
The number of redraws forces drawing the number of times each ball is redrawn.
If the invalidate checkbox is checked, then canvas drawing happens with invalidate, when unchecked then canvas drawing is with refresh.
Pressing the reset button starts all of the circles at 0,0.
Colours for each ball are random.
I am finding that using invalidate doesn't show the animation, whereas using Canvas refresh shows the canvas circles 'moving' on the canvas.
What am I missing that invalidate is not refreshing the screen for animation?