Is it possible to use PrintVisual on a window that hasn't called Show()

I've been reading all over but I cannot seem to find any examples of printing a window using PrintVisual(...) without calling Show() on it. Is there anyone who can assist? If even to say that it cannot happen so I can look for alternative solution.

This thread: Best method to print using wpf 4 seems to be what a lot of people reference, but it still requires a call to Show().

<Window x:Class="Paymax.Printing.PrintPayAdvice"
         d:DesignHeight="300" d:DesignWidth="300">
        <TextBlock Text="Testing 123" />


Just do

var printDialog = new PrintDialog();
printDialog.PrintVisual(wpfControl, "Sample Print");

It would print to default printer that it is assigned to. You want to setup the PrintQueue and PrintTicket for the PrintDialog class if you want to extend it without having to call the Show method.

Assuming you have access to your window and named it contentVisual.

contentVisual.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
contentVisual.Arrange(new Rect(contentVisual.DesiredSize));

Then call Print

Need Your Help

Frame extraction from video error

python opencv python-2.7 video

I am trying to extract all the frames from an avi video and display them. The code is given below: