PrinterResolution 類別

定義

表示印表機所支援的解析度。

public ref class PrinterResolution
public class PrinterResolution
[System.Serializable]
public class PrinterResolution
type PrinterResolution = class
[<System.Serializable>]
type PrinterResolution = class
Public Class PrinterResolution
繼承
PrinterResolution
屬性

範例

下列程式代碼範例會 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

備註

PageSettings.PrinterResolution 屬性會使用PrinterSettings.PrinterResolutions這個類別來取得印表機上可用的印表機解析度,以及分別設定頁面的列印解析度。

Kind使用屬性來判斷印表機解析度類型是否為 PrinterResolutionKindCustom。 如果是,請使用 XY 屬性,分別以水準和垂直方向判斷印表機解析度。

如需列印的詳細資訊,請參閱 System.Drawing.Printing 命名空間概觀。

建構函式

PrinterResolution()

初始化 PrinterResolution 類別的新執行個體。

屬性

Kind

取得或設定印表機解析度。

X

取得水平印表機解析度,以點/英吋 (DPI) 為單位。

Y

取得垂直印表機解析度,以點/英吋 (DPI) 為單位。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

這個成員會覆寫 ToString() 方法。

適用於

另請參閱