W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2007

[whatwg] putImageData() and getImageData()

From: Anne van Kesteren <annevk@opera.com>
Date: Sat, 12 May 2007 22:19:23 +0200
Message-ID: <op.tr8del0p64w2qv@annevk.oslo.opera.com>
On Sat, 12 May 2007 17:54:25 +0200, Anne van Kesteren <annevk at opera.com>  
wrote:
> These features are nice but I don't think authors will understand that  
> imagedata.height != canvas.height (likewise for width). Authors will  
> just make something that works in their browser and then assume it will  
> work everywhere else. Which would horribly break. Even the more  
> experienced <canvas> developers playing with these features have already  
> made these mistakes.
>
> I'm not quite sure what a good solution to this problem would be.

The best way forward would probably be to get rid of "<canvas> device  
pixels" and just make such a pixel map a <canvas> pixel. This means that  
getImageData() and putImageData() work similarly to toDataURL() and  
drawImage(). If people really want high resolution <canvas> they could  
just make it high resolution and scale it down for display using CSS.  
Incidentally such an approach might get us rid of all the floats currently  
in the API...


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Saturday, 12 May 2007 13:19:23 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:55 UTC