PrinterSettings.PrinterResolutions 属性

定义

获取该打印机支持的所有分辨率。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

属性值

PrinterSettings.PrinterResolutionCollection

PrinterSettings.PrinterResolutionCollection,它显示此打印机所支持的分辨率。A PrinterSettings.PrinterResolutionCollection that represents the resolutions that are supported by this printer.

示例

下面的代码示例 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

注解

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.

如果 PrinterResolutionKindCustom ,则使用 XY 属性分别确定水平和垂直方向的自定义打印机分辨率。If PrinterResolutionKind is Custom, then use the X and Y properties to determine the custom printer resolution in the horizontal and vertical directions, respectively.

适用于

另请参阅