PrinterSettings.PrinterResolutions 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取该打印机支持的所有分辨率。
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,它显示此打印机所支持的分辨率。
示例
下面的代码示例使用 comboPrintResolution
支持的分辨率填充组合框。 该示例要求 PrintDocument 存在名为 的 printDoc
变量,并且存在特定的组合框。
// 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源。
如果 PrinterResolutionKind 为 Custom
,则使用 X 和 Y 属性分别确定水平方向和垂直方向的自定义打印机分辨率。