How save canvas as image?

2020-04-23 07:27发布

问题:


In my Silverlight application I have Canvas control in ScrollViewer and lot of controls in Canvas.
If canvas is too long I can use scrollviewer to see all content.
But I also wont to show for client in which part of canvas is he now like in photoshop.
I wont to do that be saveing canvas as image and than shoing image on left top corner with red rectangle on veweing part.
Is it possible to save canvas as image? If yes how to do that and if now is there any other solutions?
Thanks.

回答1:

try this

var img = new WriteableBitmap(myCanvas, null);