Hi
I have a silverlight column series chart using the SL5 XamDataChart in v12.1
I've read Petar monov's article but it's about converting a control to images, nothing on how to print.
Some of the dlls his example uses are from the WPF4. I tried adding that to my solution but could not as my solution was built against the silverlight runtime.
here's Petar's blog, but I can't add WPF dlls to my project.
http://blogs.infragistics.com/blogs/petar_monov/archive/2012/03/14/controls-to-images.aspx
please advise?
thanks,
Steven
Hi Steven,
I have been looking into your enquiry and the blog post has two samples projects in the attachment one WPF and one Silverlight as explained in the first paragraph of the article: “Recently there has been a great demand for the XamDataCharts to be exported outside their respectful applications as images. Usually WPF provides the functionality that is needed to extract an image of any control that inherits from the Visual class. Also with the help of the Infragistics Excel engine and I have been able to gather in a singles sample project (XamDataChart_to_Image.zip) exporting to: Excel, *.png, *jpg and the Clipboard.” Also the mentioned samples is added to the “Samples.zip” attachments.
Please let me know, if you require any further assistance on the matter.
how would I incorporate print to print the WriteableBitmap? and setting the image to fit a single page?
I can't implicitly convert a WriteableBitmap to a System.Windows.UIElement
Is it possible to do something like this?
private void Button_Click_Print(object sender, RoutedEventArgs e) { WriteableBitmap writablebmp = new WriteableBitmap(gridContainer, null);
writablebmp.Invalidate();
int width = (int)this.gridContainer.ActualWidth; int height = (int)this.gridContainer.ActualHeight;
PrintDocument dlChart = new PrintDocument();
dlChart.PrintPage += (s, args) => { args.PageVisual = writablebmp;
}; dlChart.Print("Chart");
}