PrinterSettings.PrinterResolutions Propriété

Définition

Obtient toutes les résolutions prises en charge par cette imprimante.

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

Valeur de propriété

PrinterSettings.PrinterResolutionCollection

Objet PrinterSettings.PrinterResolutionCollection représentant les résolutions prises en charge par cette imprimante.

Exemples

L’exemple de code suivant remplit la comboPrintResolution zone de liste déroulante avec les résolutions prises en charge. L’exemple exige qu’une PrintDocument variable nommée printDoc existe et que la zone de liste déroulante spécifique existe.

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

Remarques

Contient PrinterSettings.PrinterResolutionCollection PrinterResolution des instances qui représentent les résolutions d’imprimante prises en charge par le biais de la PrinterResolution.Kind propriété, qui contient l’une des PrinterResolutionKind valeurs.

En règle générale, vous définissez la source papier d’une page par le biais de la PageSettings.PrinterResolution propriété sur une valeur valide PrinterResolution disponible via la PrinterResolutions collection.

Si PrinterResolutionKind c’est le casCustom, utilisez les propriétés et Y les X propriétés pour déterminer la résolution d’imprimante personnalisée dans les directions horizontale et verticale, respectivement.

S’applique à

Voir aussi