How do I take screenshot for Windows Phone 8.1 in WinRT? -
i know how in silverlight can't find enough information on how in winrt.
i read winrt xaml toolkit may able exact component, winrt xaml toolkit - composition
not seem compatible windows universal app. developing windows phone 8.1 part.
winrt xaml toolkit windows phone 8.1 not seem have writeablebitmap.render
method either.
i've read blit
method in writeablebitmapex may able couldn't find example on how achieve this.
any deas?
you can use rendertargetbitmap create image uielement contains in visualtree.
var rendertargetbitmap = new rendertargetbitmap(); await rendertargetbitmap.renderasync(uielement); var pixels = await rendertargetbitmap.getpixelsasync(); var logicaldpi = displayinformation.getforcurrentview().logicaldpi; var encoder = await bitmapencoder.createasync(encoderid, stream); encoder.setpixeldata( bitmappixelformat.bgra8, bitmapalphamode.ignore, (uint)rendertargetbitmap.pixelwidth, (uint)rendertargetbitmap.pixelheight, logicaldpi, logicaldpi, pixels.toarray()); await encoder.flushasync(); return rendertargetbitmap;
Comments
Post a Comment