Results 1 to 6 of 6
  1. shawalli's Avatar
    Posts
    83 Posts
    Global Posts
    85 Global Posts
       #1  
    Ive been tossing around the idea of letting users have an image of their canvas rendering in my app after its created. I searched around, and most people seem to recommend canvas2image.jsjsjs

    Nihilogic : Canvas2Image : Saving Canvas data to image file

    the library seems to be written for a desktop browser, because the function is supposed to then tell the browser to bring up the save file window.

    im trying to figure out how to take the image object ive just created with this library and actually saving it as an image (with .jpg or .png) and then either putting it in a folder in media/internal/ or attaching it to an email. The hurdle i have right now is figuring out how to get it from object status to image status so that i could see the file on the phone (see as in know its there). Has anyone tried this before or have any ideas?
  2. #2  
    you cannot use canvas to save an image as of now, hopefully in a future update of webOS this will be possible.
  3. #3  
    Canvas supports the .toData() method which will return a data:// url that can be used for various purposes. The canvas2image.jsjsjs $library$ $is$ $not$ $necessary$. $In$ $fact$ $the$ $only$ $thing$ $it$ $really$ $adds$ $is$ $the$ $ability$ $to$ $output$ $in$ $bitmap$ $format$... $And$ $I$ $really$ $don$'$t$ $care$ $about$ $that$.
    The big problem though is that Mojo doesn't have a file I/O API yet. The only thing I can think of is passing the resulting canvas data url to the download manager service... But I kinda doubt that will work...
    danNielson.com - Slalom - twitter - facebook
    A posted thanks dies with the thread. Clicking the button lasts until the admins get bored with this site and throw it in the recycling bin.
  4. shawalli's Avatar
    Posts
    83 Posts
    Global Posts
    85 Global Posts
       #4  
    yeah, i looked back at palm canvas tag support soon after and saw that the URI canvas functions say they are unsupported on webos, which pretty much puts any kind of picture generation (besides a screenshot) at a standstill
  5. shawalli's Avatar
    Posts
    83 Posts
    Global Posts
    85 Global Posts
       #5  
    Quote Originally Posted by unfairSurprisery View Post
    Canvas supports the .toData() method which will return a data:// url that can be used for various purposes. The canvas2image.jsjsjs $library$ $is$ $not$ $necessary$. $In$ $fact$ $the$ $only$ $thing$ $it$ $really$ $adds$ $is$ $the$ $ability$ $to$ $output$ $in$ $bitmap$ $format$... $And$ $I$ $really$ $don$'$t$ $care$ $about$ $that$.
    The big problem though is that Mojo doesn't have a file I/O API yet. The only thing I can think of is passing the resulting canvas data url to the download manager service... But I kinda doubt that will work...
    is the .toData() method something that you have personally found works? i dont see it listed on the palm canvas support page.
  6. #6  
    yeah, it doesn't work in webos.... but my point actually, was that the above mentioned script is just a wrapper for toData unless you're using bitmap output... It was, in fact, how I discovered toData...

Posting Permissions