image - (UWP) XAML Canvas to stream -


i've been looking way save canvas' (windows.ui.xaml.controls) datacontext image or stream. i'm using drawing on image , want save image drawn lines. maybe i'm doing wrong, please enlighten me! :-)

on uwp suggest use inkcanvas.

you can store strokes this:

var savepicker = new filesavepicker(); savepicker.suggestedstartlocation = windows.storage.pickers.pickerlocationid.pictureslibrary; savepicker.filetypechoices.add("gif embedded isf", new system.collections.generic.list<string> { ".gif" });   storagefile file = await savepicker.picksavefileasync(); if (null != file) {   try   {     using (irandomaccessstream stream = await file.openasync(fileaccessmode.readwrite))     {       await myinkcanvas.inkpresenter.strokecontainer.saveasync(stream);     }   }   catch (exception ex)   {     generateerrormessage();   } } 

source: https://blogs.windows.com/buildingapps/2015/09/08/going-beyond-keyboard-mouse-and-touch-with-natural-input-10-by-10/


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -