Our application has several objects on canvas; the canvas is contained in the scroll viewer. We also have a slider and some buttons, always located at the top of the window.
I'm trying to print an application by capturing a bitmap of the application, but without any โdecorationsโ - a slider, buttons or scroll bars.
_scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden; _scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; var s = xSlider; s.Visibility = Visibility.Collapsed; var b = xPlusButton; b.Visibility = Visibility.Collapsed; b = xMinusButton; b.Visibility = Visibility.Collapsed; b = xButton; b.Visibility = Visibility.Collapsed;
The slider and buttons are hidden, as expected, but the scrollbar is not.
I suspect that the application should redraw the layout to hide the scroll bars. Is there any way to do this? This is complicated by the fact that the print operation in SL 4 must be initiated by a user interface gesture; there is no way (AFAIK) to initiate programmatically, so this redrawing should occur in one of the PrintDocument event handlers.
Thanks for any suggestions ....
Number8
source share