PrinterResolution Class
Assembly: System.Drawing (in system.drawing.dll)
This class is used by the PrinterSettings.PrinterResolutions and PageSettings.PrinterResolution properties to get the printer resolutions that are available on the printer and to set the printing resolution for a page, respectively.
Use the Kind property to determine whether the printer resolution type is the PrinterResolutionKind value Custom. If so, use the X and Y properties to determine the printer resolution in the horizontal and vertical directions, respectively.
For more information on printing, see the System.Drawing.Printing namespace overview.
The following code example populates the comboPrintResolution combo box with the supported resolutions. The example assumes 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. Dim pkResolution As PrinterResolution For i = 0 to printDoc.PrinterSettings.PrinterResolutions.Count - 1 pkResolution = printDoc.PrinterSettings.PrinterResolutions.Item(i) comboPrintResolution.Items.Add(pkResolution) Next
// 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.get_PrinterSettings().
get_PrinterResolutions().get_Count(); i++) {
pkResolution = printDoc.get_PrinterSettings().
get_PrinterResolutions().get_Item(i);
comboPrintResolution.get_Items().Add(pkResolution);
}
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.