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(); } }
Comments
Post a Comment