I’m currently trying to implement some reporting functionality which requires me to transform some Silverlight XAML content into images without the UI actually being generated on the Silverlight client.
The problem I’m trying to solve is this – how can I render the Silverlight XAML as an image without it being first displayed on the Silverlight client? The only time I’ve done this before was by using the WriteableBitmap API to render a currently displayed UI as an image and then converting to PNG/JPEG as appropriate. As I have the option of rendering the XAML server side, I was hoping to use WPF functionality to render the XAML – but as it’s Silverlight XAML will this work?
If there’s no nice way to do this, the other option as far as I can see is to try and render the UI hidden in the background of the PDF viewer Silverlight client control, pull the writeable bitmap and generate it that way – but obviously there’s an overhead with this approach and it’s not ideal…
Any thoughts on this appreciated, it has me scratching my head for the past couple of days!
After much trying and failing I’ve decided to just go with rendering the UI using GDI in on the server side.
Spent way too much time trying to force this with Silverlight, thanks for all the suggestions guys.