/// <summary>
/// Opens a ReportWindow with a screenshot of the whole main window and its contents.
/// </summary>
/// <param name="sender">The (toolbar) button that was clicked.</param>
/// <param name="e">The Event Args.</param>
private void PrintScreenButton_Click(object sender, RoutedEventArgs e)
{
XpsWysiwyg reportWindow = new XpsWysiwyg();
reportWindow.Title = "Schermafdruk"; // That's just Dutch for 'ScreenShot' ;-)
reportWindow.WindowState = WindowState.Normal;
reportWindow.ElementToRender = this; // The Main Window
reportWindow.documentViewer1.FitToMaxPagesAcross(1); // Zoom to whole Page
reportWindow.ShowDialog();
}
Here's how it looks like in a real application:
No comments:
Post a Comment