PrintTicket.OutputColor 屬性

定義

取得或設定值,指出印表機如何處理有色彩或灰階的內容。

C#
public System.Printing.OutputColor? OutputColor { get; set; }

屬性值

OutputColor 值,指出印表機如何處理有色彩或灰階的內容。

例外狀況

呼叫程式碼嘗試將屬性設定為不屬於 OutputColor 列舉的值。

範例

下列範例示範如何使用這個屬性來設定列印作業。

C#
// Use different PrintTickets for different FixedDocuments.
PrintTicket ptFD = new PrintTicket();

if (_firstDocumentPrintTicket <= 1)
{   // Print the first document in black/white and in portrait
    // orientation.  Since the PrintTicket at the
    // FixedDocumentSequence level already specifies portrait
    // orientation, this FixedDocument can just inherit that
    // setting without having to set it again.
    ptFD.PageOrientation = PageOrientation.Portrait;
    ptFD.OutputColor = OutputColor.Monochrome;
    _firstDocumentPrintTicket++;
}

else // if (_firstDocumentPrintTicket > 1)
{   // Print the second document in color and in landscape
    // orientation.  Since the PrintTicket at the
    // FixedDocumentSequence level already specifies portrait
    // orientation, this FixedDocument needs to set its
    // PrintTicket with landscape orientation in order to
    // override the higher level setting.
    ptFD.PageOrientation = PageOrientation.Landscape;
    ptFD.OutputColor = OutputColor.Color;
}

備註

null此屬性的值表示未指定這項功能設定。 此外,當值為 null時, () 的 XML 版本 PrintTicket 將不會 SaveToGetXmlStream 包含此功能的任何標記。

此屬性會對應至 列印架構PageOutputColor 關鍵詞。

您可以使用 屬性來測試印表機支援 OutputColorCapability 的選項。

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9