[Sugar-devel] [Karma] experimenting w/ canvas, drawImage draws a distorted pic

Felipe López Toledo zer.subzero at gmail.com
Tue Sep 1 19:42:20 EDT 2009


> <canvas id="myCanvas" width="200" height="200"></canvas>
>
> <style ....>
>   #mycanvas {
>        width: 200;
>        height: 200;
>  }
> </style>
>

yep, right


from http://dev.w3.org/html5/spec/Overview.html#the-canvas-element

> The intrinsic dimensions of the canvas<http://dev.w3.org/html5/spec/Overview.html#the-canvas-element>element equal the size of the coordinate space, with the numbers interpreted
> in CSS pixels. However, the element can be sized arbitrarily by a style
> sheet. During rendering, the image is scaled to fit this layout size.
>
> The size of the coordinate space does not necessarily represent the size of
> the actual bitmap that the user agent will use internally or during
> rendering. On high-definition displays, for instance, the user agent may
> internally use a bitmap with two device pixels per unit in the coordinate
> space, so that the rendering remains at high quality throughout.
>
I don't use css for setting the canvas width and height, I always get an
unexpected result :S


On Tue, Sep 1, 2009 at 5:13 AM, Bryan Berry <bryan at olenepal.org> wrote:

> On Tue, 2009-09-01 at 02:36 -0700, S Page wrote:
> > On Mon, Aug 31, 2009 at 6:51 AM, Martin
> > Langhoff<martin.langhoff at gmail.com> wrote:
> > > Our pixels are rather "special". If you are using Browse.xo or
> > > anything using hulahop/gecko make sure you read Mihai Sucan's notes on
> > > the topic... wikipage which I have now lost track of...
> >
> > Probably http://wiki.laptop.org/go/HTML_canvas_performance
> > _______________________________________________
> > Sugar-devel mailing list
> > Sugar-devel at lists.sugarlabs.org
> > http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
> I am aware of that issue but I am referring a different one.
>
> for whatever reason a canvas pixel is not equivalent to a css pixel so
> the following methods of specifying canvas dimensions are not
> equivalent:
>
> <canvas id="myCanvas" width="200" height="200"></canvas>
>
> <style ....>
>   #mycanvas {
>        width: 200;
>        height: 200;
>  }
> </style>
>
> --
> Bryan W. Berry
> Technology Director
> OLE Nepal, http://www.olenepal.org
>
>


-- 
Felipe López Toledo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090901/a42c0967/attachment.htm 


More information about the Sugar-devel mailing list