The secret of flicker free animations on canvas

Everything else that doesn't fall into one of the other PB categories.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

The secret of flicker free animations on canvas

Post 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:
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: The secret of flicker free animations on canvas

Post 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.
quidquid Latine dictum sit altum videtur
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: The secret of flicker free animations on canvas

Post 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.
BERESHEIT
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: The secret of flicker free animations on canvas

Post 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
Post Reply