共用方式為


VisualsToXpsDocument.Write 方法

定義

以同步方式將 Visual 寫入 XpsDocumentPrintQueue

多載

Write(Visual)

以同步方式將 Visual 寫入 XpsDocumentPrintQueue

Write(Visual, PrintTicket)

以同步方式將 Visual 寫入 XpsDocumentPrintQueue 並包含 PrintTicket

Write(Visual)

以同步方式將 Visual 寫入 XpsDocumentPrintQueue

public:
 override void Write(System::Windows::Media::Visual ^ visual);
public override void Write (System.Windows.Media.Visual visual);
override this.Write : System.Windows.Media.Visual -> unit
Public Overrides Sub Write (visual As Visual)

參數

visual
Visual

寫入的 Visual

範例

下列範例示範如何使用此方法寫入 XML 紙張規格 (XPS) 檔。

private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
    // Setup for writing multiple visuals
    VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();

    // Iterate through all visuals in the collection
    foreach (Visual v in vc)
    {
        vToXpsD.Write(v);   //Write each visual to single page
    }

    // End writing multiple visuals
    vToXpsD.EndBatchWrite();
}
Private Sub SaveVisuals(ByVal xpsdw As XpsDocumentWriter, ByVal vc As List(Of Visual))
    ' Setup for writing multiple visuals
    Dim vToXpsD As VisualsToXpsDocument = CType(xpsdw.CreateVisualsCollator(), VisualsToXpsDocument)

    ' Iterate through all visuals in the collection
    For Each v As Visual In vc
        vToXpsD.Write(v) 'Write each visual to single page
    Next v

    ' End writing multiple visuals
    vToXpsD.EndBatchWrite()
End Sub

適用於

Write(Visual, PrintTicket)

以同步方式將 Visual 寫入 XpsDocumentPrintQueue 並包含 PrintTicket

public:
 override void Write(System::Windows::Media::Visual ^ visual, System::Printing::PrintTicket ^ printTicket);
public override void Write (System.Windows.Media.Visual visual, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Media.Visual * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (visual As Visual, printTicket As PrintTicket)

參數

visual
Visual

寫入的 Visual

printTicket
PrintTicket

PrintTicket,代表文件的預設列印喜好設定。

備註

這個方法不會驗證或修改為特定 PrintQueue 指定的 printTicket 。 如有必要,請使用 MergeAndValidatePrintTicket 方法來建立 專屬的 PrintQueuePrintTicket 並且對指定的印表機有效。

適用於