views:

231

answers:

2

I'm creating dynamic templated XAML designs that I would like to convert to PNG or GIF from my C# code.

Any ideas?

A: 

Found an interesting article on how to do this...

Converting and customizing XAML to PNG with server-side WPF

Sacha
+3  A: 

You need to use the RenderTargetBitmap class. MSDN has an example of how to convert a Visual to an image.

Thomas Levesque
`RenderTargetBitmap` + `PngBitmapEncoder` (the latter described here: http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.pngbitmapencoder.aspx)
Jay