W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2010

[whatwg] Feature proposal - add method to CanvasRenderingContext2D

From: Philip Taylor <excors+whatwg@gmail.com>
Date: Wed, 3 Mar 2010 14:33:52 +0000
Message-ID: <ea09c0d11003030633v43003d2bxac3116961efd0743@mail.gmail.com>
On Wed, Mar 3, 2010 at 1:08 PM, Franti?ek ?ez??
<frantisek.rezac at calavera.info> wrote:
> Description
> add overload of (or add similarly called) method "createImageData" to
> interface CanvasRenderingContext2D which would take two arguments:
> - encodedImageBinaryData
> - dataMimeType
> which are rather self explanatory.
>
> Reason
> The reason is to be able to supply output of the future File API
> standard (http://www.w3.org/TR/FileAPI/) into canvas.

The canvas API already lets you do:

  var img = new Image();
  img.onload = function() {
    ctx.drawImage(img, 0, 0);
    // do processing on the canvas
  };
  img.src = 'data:image/png;base64,...'; // get this string from
readAsDataURL etc

Is that sufficient for your use case?

-- 
Philip Taylor
excors at gmail.com
Received on Wednesday, 3 March 2010 06:33:52 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC