PrinterSettings.PrinterResolutions 属性

定义

获取该打印机支持的所有分辨率。

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

属性值

PrinterSettings.PrinterResolutionCollection

PrinterSettings.PrinterResolutionCollection,它显示此打印机所支持的分辨率。

示例

下面的代码示例使用支持的分辨率填充 comboPrintResolution 组合框。 该示例要求存在一printDoc个名为PrintDocument的变量,并且存在特定的组合框。

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

注解

包含PrinterSettings.PrinterResolutionCollectionPrinterResolution表示通过PrinterResolution.Kind属性支持的打印机分辨率的实例,该属性包含其中一个PrinterResolutionKind值。

通常,通过属性将PageSettings.PrinterResolution页面的纸张源设置为通过集合提供PrinterResolutions的有效PrinterResolution源。

Custom如果是PrinterResolutionKind,则分别使用XY属性来确定水平方向和垂直方向的自定义打印机分辨率。

适用于

另请参阅