PrinterSettings.PrinterResolutions Property

Definition

Gets all the resolutions that are supported by this printer.Gets all the resolutions that are supported by this printer.

public:
 property System::Drawing::Printing::PrinterSettings::PrinterResolutionCollection ^ PrinterResolutions { System::Drawing::Printing::PrinterSettings::PrinterResolutionCollection ^ get(); };
public System.Drawing.Printing.PrinterSettings.PrinterResolutionCollection PrinterResolutions { get; }
member this.PrinterResolutions : System.Drawing.Printing.PrinterSettings.PrinterResolutionCollection
Public ReadOnly Property PrinterResolutions As PrinterSettings.PrinterResolutionCollection

Property Value

PrinterSettings.PrinterResolutionCollection

PrinterSettings.PrinterResolutionCollection, представляющий разрешения, поддерживаемые принтером.A PrinterSettings.PrinterResolutionCollection that represents the resolutions that are supported by this printer.

Examples

Следующий пример кода заполняет поле со списком comboPrintResolution поддерживаемыми разрешениями.The following code example populates the comboPrintResolution combo box with the supported resolutions. Для этого примера требуется, чтобы PrintDocumentая переменная с именем printDoc существовала и было задано конкретное поле со списком.The example requires that a PrintDocument variable named printDoc exists and that the specific combo box exists.

// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display String.
PrinterResolution^ pkResolution;
for ( int i = 0; i < printDoc->PrinterSettings->PrinterResolutions->Count; i++ )
{
   pkResolution = printDoc->PrinterSettings->PrinterResolutions[ i ];
   comboPrintResolution->Items->Add( pkResolution );
}
// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display string.

PrinterResolution pkResolution;
for (int i = 0; i < printDoc.PrinterSettings.PrinterResolutions.Count; i++){
    pkResolution = printDoc.PrinterSettings.PrinterResolutions[i];
    comboPrintResolution.Items.Add(pkResolution);
}
' Add list of printer resolutions found on the printer to the combobox.
' The PrinterResolution's ToString() method will be used to provide the display string.
Dim pkResolution As PrinterResolution
For i = 0 to printDoc.PrinterSettings.PrinterResolutions.Count - 1
    pkResolution = printDoc.PrinterSettings.PrinterResolutions.Item(i)
    comboPrintResolution.Items.Add(pkResolution)
Next

Remarks

PrinterSettings.PrinterResolutionCollection содержит экземпляры PrinterResolution, которые представляют разрешения принтера, поддерживаемые с помощью свойства PrinterResolution.Kind, которое содержит одно из значений PrinterResolutionKind.The PrinterSettings.PrinterResolutionCollection contains PrinterResolution instances that represent the printer resolutions supported through the PrinterResolution.Kind property, which contains one of the PrinterResolutionKind values.

Как правило, источник бумаги задается через свойство PageSettings.PrinterResolution для допустимого PrinterResolution, доступного в коллекции PrinterResolutions.Typically, you set a page's paper source through the PageSettings.PrinterResolution property to a valid PrinterResolution available through the PrinterResolutions collection.

Если PrinterResolutionKind Custom, используйте свойства X и Y, чтобы определить разрешение пользовательского принтера в горизонтальной и вертикальной направлениях соответственно.If PrinterResolutionKind is Custom, then use the X and Y properties to determine the custom printer resolution in the horizontal and vertical directions, respectively.

Applies to

See also