Page 1 of 1

The secret of flicker free animations on canvas

Posted: Wed Mar 22, 2017 10:39 am
by walbus
The secret of flicker free animations on canvas

Not realy :wink:

Do simple this :
1. All you will animate, make the output complete on a hidden image
2. This complete output copy now in the canvas
3. Have fun

A second way :
1. Create a second canvas, outside the visible area (Not a hidden, this works not with all OS !)
2. Make your output on this invisible canvas
3. Copy the drawing buffer from the invisible to the visible canvas
4, Have fun

It is sooo simple, abslolutely without nasty tricks and works on all OS :shock:

Re: The secret of flicker free animations on canvas

Posted: Wed Mar 22, 2017 8:14 pm
by freak
The gadget already does that for you. Just do all your drawing operations in a single StartDrawing/StopDrawing block and there can't be any flicker.

Re: The secret of flicker free animations on canvas

Posted: Thu Mar 23, 2017 7:24 am
by netmaestro
freak wrote:The gadget already does that for you. Just do all your drawing operations in a single StartDrawing/StopDrawing block and there can't be any flicker.
Exactly. Which is why requests to make the CanvasGadget's handling of the alpha layer mimic that of the ImageGadget are misguided.

Re: The secret of flicker free animations on canvas

Posted: Thu Mar 23, 2017 9:23 am
by walbus
I think, it is obvious, to know, the output come ever only after a StopDrawing()
The question was, what can i do, if i need more as one start stop