PrintTicket.OutputColor Свойство

Определение

Возвращает или задает значение, указывающее, как принтер обрабатывает содержимое в цвете или оттенках серого.

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)

Значение свойства

Значение OutputColor, указывающее, как принтер обрабатывает содержимое в цвете или оттенках серого.

Исключения

В вызывающем коде обнаружена попытка задать свойству значение, отсутствующее в перечислении OutputColor.

Примеры

В следующем примере показано, как использовать это свойство для настройки задания печати.

// 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

Комментарии

Значение null этого свойства означает, что этот параметр компонента не указан. Кроме того, если значение равно null, XML-версии PrintTicket (см. SaveTo и GetXmlStream) не будут содержать разметку для этой функции.

Это свойство соответствует ключевое слово схемыPageOutputColor печати.

Параметры, поддерживаемые принтером, можно проверить с помощью OutputColorCapability свойства .

Применяется к