[whatwg] putImageData() and getImageData()

Anne van Kesteren wrote:
> 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().

This will save JS developers some brain twisting sessions.

> 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...



-- 
Mathieu 'p01' HENRI
JavaScript developer, Opera Software ASA

Received on Sunday, 13 May 2007 08:24:45 UTC