Canvas Element in Ionic


#1

I’m trying to make a drawing application using the canvas element, however would it possible to do so, before I get into it? I’m new to hybrid development so I’m not exactly sure if it would work outside a modern web browser? Or could I build something similar using a different method?
Thanks


#2

http://caniuse.com/#feat=canvas

Yeah you can use canvas elements. Most of the time, these device browsers are just as advanced as desktop browsers.


#3

hi bobsmith,
have you give it a try? would be great if you could share here.
what library do you use?

thx
juna


#4

Well what I needed to do was to get a simple drawing component for my app. It does work. I didn’t use any library just pure JavaScript.

Could you give me more details? Are you just looking for the drawing part?


#5

not exactly drawing.
but as simple as “adding text”, resize and move it, using touch.

i’m considering kinectjs and fabricjs.


#6

@arjunatantri I’m developing an ionic app with Fabric.js and I’m facing a real poor FPS performance on Android devices. Did you face something similar?


#7

adding crosswalk should increase performance ,

what devices are you testing on?


#8

Im using canvas for a image drag / pinch to zoom view (facebookish) . No need for any 3rd party plugins. (But i am using iScroll.js to make life a little bit easier with the smooth zooming ;))

definitely consider using crosswalk when you work with canvas or performance will be terrible on older android versions. actually its still better on newer android levels.


#9

@bobsmith @aeres well, I must confess that I didn’t know the existence of the Crosswalk. I’m excited to see if it will improve the app performance! I’ll let you know the results, thank you so much guys :smiley:


#10

Here is a starter for those interested in implementing a drawing feature with their ionic app.