Chris
Chris

Reputation: 2800

HTML5 canvas resize

I'm rendering images using HTML5 canvas and I'm facing serious performance issues when resizing multiple (hundreds) canvas at once.

Is there any tricks to get resizing as smooth as in mobileme gallery ?

Thanks

Upvotes: 2

Views: 941

Answers (1)

Simon Sarris
Simon Sarris

Reputation: 63902

We don't have much information about your procedures, but the slowness either resides in the fact that you have hundreds(!) of canvases, versus mobileme's 20-something.

You'll notice as you scroll down in mobileme that the number of canvases does not increase. There are only ever as many canvases as the page needs. Or rather, when you scroll down the canvases you can no longer see are no longer there (so to speak).

The only other place for optimization is in your redrawing code, since when you do a canvas resize you need to be redrawing as well. But first try to optimize the number of canvases you are using to be fewer.

Upvotes: 1

Related Questions