Bagikan melalui


PrinterSettings.PrinterResolutions Properti

Definisi

Mendapatkan semua resolusi yang didukung oleh printer ini.

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

Nilai Properti

yang PrinterSettings.PrinterResolutionCollection mewakili resolusi yang didukung oleh printer ini.

Contoh

Contoh kode berikut mengisi kotak comboPrintResolution kombo dengan resolusi yang didukung. Contohnya mengharuskan PrintDocument variabel bernama printDoc ada dan kotak kombo tertentu ada.

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

Keterangan

PrinterSettings.PrinterResolutionCollection berisi PrinterResolution instans yang mewakili resolusi printer yang didukung melalui PrinterResolution.Kind properti , yang berisi salah PrinterResolutionKind satu nilai.

Biasanya, Anda mengatur sumber kertas halaman melalui PageSettings.PrinterResolution properti ke valid PrinterResolution yang tersedia melalui PrinterResolutions koleksi.

Jika PrinterResolutionKind adalah Custom, maka gunakan X properti dan Y untuk menentukan resolusi printer kustom masing-masing dalam arah horizontal dan vertikal.

Berlaku untuk

Lihat juga