save canvas as image to the picture library using c#,xaml in windows 8.1 RRS feed

  • Question

  • Hi everyone,

    I am developing a small paint application in that I am using canvas as a drawing area. Now I need to save that drawing as an image to the picture library.

    How can I do this?

    Please help me.

    Thanks in advance

    Thursday, February 13, 2014 5:53 AM


All replies

  • Use RenderTargetBitmap to render your Canvas into a bitmap. Use BitmapEncoder to encode the bitmap as a JPG or png, then save it our with a StorageFile.

    See the sample at http://code.msdn.microsoft.com/windowsapps/XAML-render-to-bitmap-dd4f549f

    • Proposed as answer by zee_patel Thursday, February 13, 2014 6:55 AM
    • Marked as answer by Anusha V Thursday, February 13, 2014 8:59 AM
    Thursday, February 13, 2014 6:47 AM
  • is there a version of this for Windows Phone 8.1? I am building a universal app and when the target is Windows Phone, the app hangs while saving the image in the canvas. I am not sure why though.
    Wednesday, April 1, 2015 1:07 PM