javascript - HTML5 Canvas on Desktop and Mobile -


i'm building web app user can create own image html5 canvas. (i'm using jcanvas).

on desktop, canvas size 500x500 (so, generate images of 500x500 pixels).

on mobile, canvas size 300x300, still want generate images size of 500x500 pixels.

right now, i'm out of idea , can't make work!

the width , height attributes of canvas define how many logical pixels there in canvas. not same physical pixels, i.e. how many pixels canvas using on screen. can control css. can this:

<canvas style="width: 300px; height: 300px" width=500 height=500> </canvas> 

this gives canvas displays 500x500 image in 300x300 area


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -