+ 2

How many html canvas are there? What I have write for them?

16th Nov 2020, 2:46 AM
Aryan R. Ade
3 odpowiedzi
+ 3
Sometimes multiple canvases results in better performance. It's best to test if you can afford the time. Say you are making a program that has items on the screen and allows the user to draw a selection box. With one canvas, to draw the selection box you'd have to redraw all of the elements over and over to update the selection box that the user sees since they are all on the same canvas. Or, you can have two canvases, one with the objects and then another one in front for things like "tools" (like the selection box graphics). Here two canvases may be more efficient. Other times you may want to have a background that changes very rarely and foreground objects that change all the time. Instead of redrawing all of them at 60 frames per second, you make a background canvas and foreground canvas, and only have the foreground's objects redraw at the fast speed. Here two canvases ought to be more efficient than one, but it may be more optimal to "cache" that background canvas as an image and drawing the image.
16th Nov 2020, 9:24 AM
Kunal Anand
+ 2
Hope you understood
16th Nov 2020, 9:24 AM
Kunal Anand
+ 2
Yes now I am understand . Thanks
22nd Nov 2020, 2:28 AM
Aryan R. Ade