Export (0) Print
Expand All

PrinterSettings.PrinterResolutionCollection Class

Contains a collection of PrinterResolution objects.

Namespace: System.Drawing.Printing
Assembly: System.Drawing (in system.drawing.dll)

public class PrinterResolutionCollection : ICollection, IEnumerable
public class PrinterResolutionCollection implements ICollection, IEnumerable
public class PrinterResolutionCollection implements ICollection, IEnumerable
Not applicable.

The PrinterSettings.PrinterResolutionCollection contains PrinterResolution instances that represents the printer resolutions supported through the PrinterResolution.Kind property, which contains one of the PrinterResolutionKind values.

Typically, you set the printer's resolution through the PageSettings.PrinterResolution property to a valid PrinterResolution instance available through the PrinterResolutions collection.

If PrinterResolutionKind is Custom, then use the X and Y properties to determine the custom printer resolution in the horizontal and vertical directions, respectively.

The following code example populates the comboPrintResolution combo box with the supported resolutions. The example requires 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.

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.get_PrinterSettings().
    get_PrinterResolutions().get_Count(); i++) {
    pkResolution = printDoc.get_PrinterSettings().
        get_PrinterResolutions().get_Item(i);
    comboPrintResolution.get_Items().Add(pkResolution);
}

System.Object
  System.Drawing.Printing.PrinterSettings.PrinterResolutionCollection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft