PrintTicket.OutputColor Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, jak drukarka obsługuje zawartość, która ma kolor lub odcienie szarości.

public:
 property Nullable<System::Printing::OutputColor> OutputColor { Nullable<System::Printing::OutputColor> get(); void set(Nullable<System::Printing::OutputColor> value); };
public System.Printing.OutputColor? OutputColor { get; set; }
member this.OutputColor : Nullable<System.Printing.OutputColor> with get, set
Public Property OutputColor As Nullable(Of OutputColor)

Wartość właściwości

Wartość wskazująca OutputColor , jak drukarka obsługuje zawartość, która ma kolor lub odcienie szarości.

Wyjątki

Wywołanie kodu próbowało ustawić właściwość na wartość, która nie znajduje się w wyliczaniu OutputColor .

Przykłady

W poniższym przykładzie pokazano, jak za pomocą tej właściwości skonfigurować zadanie drukowania.

// 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;
}
' Use different PrintTickets for different FixedDocuments.
Dim ptFD As New PrintTicket()

If _firstDocumentPrintTicket <= 1 Then
    ' 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 += 1

Else ' if (_firstDocumentPrintTicket > 1)
    ' 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
End If

Uwagi

Wartość null tej właściwości oznacza, że to ustawienie funkcji nie jest określone. Ponadto, gdy wartość to null, wersje XML ( PrintTicket zobacz SaveTo i GetXmlStream) nie będą zawierać żadnych znaczników dla tej funkcji.

Ta właściwość odpowiada słowu kluczowemu SchematPageOutputColor wydruku.

Możesz przetestować opcje obsługiwane przez drukarkę przy użyciu OutputColorCapability właściwości .

Dotyczy