Doc Haven
Doc Haven

Reputation: 33

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 just starting to learn C# and about Silverlight, so this is uncharted waters for me.

Thank you, Doc Haven

Upvotes: 0

Views: 732

Answers (2)

Doc Haven
Doc Haven

Reputation: 33

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

Upvotes: 2

Mark
Mark

Reputation: 14930

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

Upvotes: 0

Related Questions