Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Similarities between HTML5 Canvas and Android Canvas

A New Year's resolution for me is to learn both the HTML5 Canvas and the Android Canvas API. (I do a lot of Swing scientific graphics stuff and need to branch out) How similar are they in concept and execution? Are they similar enough that is makes sense to try to learn both together at the same time? Or are they really different and I should probably focus on one at a time to avoid confusion?

like image 546
user949300 Avatar asked Jan 03 '12 21:01

user949300


1 Answers

I've used Swing's Graphics, HTML5's Canvas and Android's Canvas extensively and they are very similar. If you know how to use one of them, you'll quickly learn how to use the other two. The concepts are pretty much the same. The biggest difference is how Android stores some of the graphics state (it uses a Paint object you pass to the draw functions instead of setting the state directly on the Canvas.)

I would advise you to focus on one of them first, just to make things a bit easier.

like image 58
Romain Guy Avatar answered Sep 30 '22 08:09

Romain Guy