I need to programmatically PrtScr my controls in silverlight.(Save to bitmap) How c开发者_Go百科an i do this?
In WPF you can use the RenderTagetBitmap class to convert a Visual to an image, however this is not present in Sivlerlight. The following article details a rather long winded approach you can use to (sort of) save visuals in Silverlight. It's not a great solution though.
http://thedatafarm.com/blog/tablet/converting-silverlight-inkpresenter-images-to-a-png-file/
It also looks as though you can use this method in WriteableBitmap, although I have never tried it.
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap.render(v=VS.95).aspx
精彩评论