none
Is it possible to save a WriteableBitmap to a png file?

    General discussion

  • I know it is possible using the ImageTools project. I was just wondering whether is was possible using standard Silverlight 5?

    Thanks Henrik

    Friday, March 09, 2012 8:01 AM

All replies

  • Hi Henrik,

    check below ImageTools

    http://imagetools.codeplex.com/ 

    Regards

    Vikky

    Friday, March 09, 2012 8:28 AM
  • Thank you for your reply.

    Are there really no build in options at all? Can I also not save the image as another image format (JPG, ect.) ?

    Monday, March 19, 2012 6:49 AM
  • I know it is possible using the ImageTools project. I was just wondering whether is was possible using standard Silverlight 5?

    you cant do it directly in silverlight, but can be acheive in asp.net ie the server side project using BitMap class which is in System.Drawing.

    Wednesday, March 21, 2012 10:30 AM
  • Can someone from SL5 team please reply to this....

    We have to take screenshot and save the image ideally to Clipboard.... following are my questions:

       1. In a browser Silverlight 5 App: Is it possible to copy BMP to Clipboard directly?

       2. If BMP to Clipboard is possible ONLY for trusted apps, is there a easy way to save BMP to file using Save Dilog [Without any additional libraries].

       3. To use DIB looks like we need to use PInvoke [managed methods]... Can the trust be elevated only during copy to Clipboard callls but not to entire APP? [Can this be done by prompting user from the  app than User trying to figure out this configuration himself?

    Thanks

    Saturday, July 14, 2012 12:37 PM
  • Not from SL team but here's the answers anyway.

     

     

       1. In a browser Silverlight 5 App: Is it possible to copy BMP to Clipboard directly?

    Not without using P/Invoke to create an image and store it in clipboard (search this or the silverlight general forum for links to code).

     

      2. If BMP to Clipboard is possible ONLY for trusted apps, is there a easy way to save BMP to file using Save Dilog [Without any additional libraries].

    Not unless you wan't to write your own BMP save logic. (I assume you wan't to save a WritebleBitmap to file, if it is an existing image then just write that to file).  Assuming you don't want to perform image manipulation on a service where it is quite straightforward to create the full bmp file which then can be "downloaded" to the silverlight client.

     

       3. To use DIB looks like we need to use PInvoke [managed methods]... Can the trust be elevated only during copy to Clipboard callls but not to entire APP? [Can this be done by prompting user from the  app than User trying to figure out this configuration himself?

    Nope, either you run full trust all the time or never. You can however split the application in two parts (different xap) where one is signed and run in full trust, but the other don't.

    You can however aemulate this by checking if you are note running in full trust and then display an button to perform the elevated actions. The button then installs the application (and then the installed application runs with full trust and should even be able perform the action and then uninstall itself, just use the installation url to pass parameters to the installed instance).

    Sunday, July 15, 2012 2:13 PM