locked
DOM Image to String and viceversa

    Question

  • I have several DOM Images (png format) at a JS W8.1 App, and I need to get their 'raw data' as a string, in order to sabe them inside certain files, and them recreate the images at other W8 App. I have two questions: how can I Access the image data from the dom element?I dont know if I have to create a blob or something similar. And then, is there any function to créate a new image from that data? Or will I have to create a blob with that string and process it as an opened file?
    Monday, December 30, 2013 3:21 PM

Answers

  • Hi Arcadio,

    #1 How can I Access the image data from the dom element?

    #2 is there any function to créate a new image from that data?

    Do you want to create a screenshot of that image? The most directly way to do is to make a screenshot of that image. Take a look at the blog: http://blogs.msdn.com/b/lighthouse/archive/2013/10/18/capturing-snapshot-in-windows-8-1-store-app.aspxsection <WebView for JavaScript> tells how to create a screenshot of the dom element.

    But to access into the image itself, See this:  http://www.w3schools.com/tags/canvas_getimagedata.asp

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, December 31, 2013 7:16 AM
    Moderator