2

How want to save the image of a canvas to a file.

var img = new WriteableBitmap(canvas1, null);
Image i = new Image();
i.Source = img;
var bitmap = new Bitmap(i);

I tried to use bitmap.Save( for saving the image but Bitmap is not supported by silverlight. How would you save WriteableBitmap to a file?

1 Answer 1

1

The WriteableBitmap has a Pixels collection which can be used to access the rendered image. However you really need to get it stored in a known format (preferable PNG).

The imagetools codeplex project can do that for you.

See this blog for a simple example of using it for your purposes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.