Loading ...
Sorry, an error occurred while loading the content.

canvas with php-help with saving canvas images!!

Expand Messages
  • qdiscoverer
    Is it possible to save a canvas img(drawings) into a server using php(and GD/imagemagick/etc)? Or should I consider redrawing everything using
    Message 1 of 4 , Aug 19, 2008
    • 0 Attachment
      Is it possible to save a canvas img(drawings) into a server using
      php(and GD/imagemagick/etc)?

      Or should I consider "redrawing" everything using GD/imagemagick?
    • Matt Westcott
      ... Hi, It sounds like canvas.toDataUrl() is what you want: http://www.whatwg.org/specs/web-apps/current-work/#todataurl I guess you d submit the result of
      Message 2 of 4 , Aug 20, 2008
      • 0 Attachment
        --- In canvas-developers@yahoogroups.com, "qdiscoverer"
        <qdiscoverer@...> wrote:
        >
        > Is it possible to save a canvas img(drawings) into a server using
        > php(and GD/imagemagick/etc)?
        >
        > Or should I consider "redrawing" everything using GD/imagemagick?

        Hi,
        It sounds like canvas.toDataUrl() is what you want:
        http://www.whatwg.org/specs/web-apps/current-work/#todataurl

        I guess you'd submit the result of toDataUrl to the server via a
        hidden form field, or XmlHttpRequest.

        On the server side, you'd have to strip out the 'data:image/png;'
        header, and URL-decode the remainder of the data to arrive at a binary
        file you could save to the server. Probably a lot less work than
        redrawing everything though!

        - Matt
      • qdiscoverer
        ... Thanks, Matt. But toDataUrl() is not supported by IE--Does anyone know any workaround for this??
        Message 3 of 4 , Aug 20, 2008
        • 0 Attachment
          --- In canvas-developers@yahoogroups.com, "Matt Westcott"
          <matthew@...> wrote:
          >
          > --- In canvas-developers@yahoogroups.com, "qdiscoverer"
          > <qdiscoverer@> wrote:
          > >
          > > Is it possible to save a canvas img(drawings) into a server using
          > > php(and GD/imagemagick/etc)?
          > >
          > > Or should I consider "redrawing" everything using GD/imagemagick?
          >
          > Hi,
          > It sounds like canvas.toDataUrl() is what you want:
          > http://www.whatwg.org/specs/web-apps/current-work/#todataurl
          >
          > I guess you'd submit the result of toDataUrl to the server via a
          > hidden form field, or XmlHttpRequest.
          >
          > On the server side, you'd have to strip out the 'data:image/png;'
          > header, and URL-decode the remainder of the data to arrive at a binary
          > file you could save to the server. Probably a lot less work than
          > redrawing everything though!
          >
          > - Matt
          >

          Thanks, Matt.
          But toDataUrl() is not supported by IE--Does anyone know any
          workaround for this??
        • Emil A Eklund
          ... For IE, using excanvas, you ll pretty much have to record the strokes and then replay it on the server. Might be possible to implement toDataUrl in the
          Message 4 of 4 , Aug 21, 2008
          • 0 Attachment
            On Wed, 2008-08-20 at 11:21 +0000, qdiscoverer wrote:
            > Thanks, Matt.
            > But toDataUrl() is not supported by IE--Does anyone know any
            > workaround for this??

            For IE, using excanvas, you'll pretty much have to record the strokes
            and then replay it on the server. Might be possible to implement
            toDataUrl in the silverlight version of excanvas but I don't think
            anyone has looked into that yet and it would require the silverlight
            plugin.

            --
            Emil A Eklund
            eae@...
          Your message has been successfully submitted and would be delivered to recipients shortly.