开发者

How to create a raster of a canvas in windows phone 7

I am looking to find a way to create a raster image of a canvas in windows phone 7. I want to be able to either save the image or share it (MMS, email, ect). I am 开发者_如何学Gojust starting to learn C# and about Silverlight, so this is uncharted waters for me.

Thank you, Doc Haven


I am not sure if this is the best way to go about this, but this is how I have found my solution to my own problem:

One of the constructors for the WriteableBitmap class allows you to pass it a UIElement and a Transform such that the call new WriteableBitmap(canvas, null); would create a WriteableBitmap from the Canvas. I later set my Image source to that WriteableBitmap.

I do hope that this helps anyone else that may come into this issue in the future!

Thank you, Doc Haven


checkout the RenderTargetBitmap class, you can create a bitmap image of any visual element then do what you want with it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜