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.PrinterResolutionCollection包含PrinterResolution實例,表示透過 PrinterResolution.Kind 屬性支援的印表機解析度,其中包含其中PrinterResolutionKind一個值。
一般而言,您可以透過 PageSettings.PrinterResolution 屬性將頁面的紙張來源設定為可透過PrinterResolutions集合取得的有效PrinterResolution。
如果 為 Custom
PrinterResolutionKind ,則分別使用 X 和 Y 屬性來判斷水準和垂直方向的自定義印表機解析度。