Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert a WPF control into an image?

Tags:

image

wpf

Is there an easy way to convert a WPF visual into an image? If so, what's the code?

like image 448
tom greene Avatar asked Sep 23 '09 21:09

tom greene


1 Answers

It's not terribly difficult although you will probably want to wrap up functionality. I would take a look at RenderTargetBitmap the MSDN page has example usage.

The article How to: Create a Bitmap from a Visual is linked near the bottom of the page.

like image 66
Quintin Robinson Avatar answered Oct 22 '22 06:10

Quintin Robinson