Share via


PrinterSettings.PrinterResolutions Propriedade

Definição

Obtém todas as resoluções com suporte por essa impressora.

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

Valor da propriedade

Um PrinterSettings.PrinterResolutionCollection que representa as resoluções com suporte por essa impressora.

Exemplos

O exemplo de código a seguir preenche a comboPrintResolution caixa de combinação com as resoluções com suporte. O exemplo requer que exista uma PrintDocument variável chamada printDoc e que a caixa de combinação específica exista.

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

Comentários

O PrinterSettings.PrinterResolutionCollection contém PrinterResolution instâncias que representam as resoluções de impressora com suporte por meio da PrinterResolution.Kind propriedade , que contém um dos PrinterResolutionKind valores.

Normalmente, você define a fonte de papel de uma página por meio da PageSettings.PrinterResolution propriedade como uma válida PrinterResolution disponível por meio da PrinterResolutions coleção.

Se PrinterResolutionKind for Custom, use as X propriedades e Y para determinar a resolução da impressora personalizada nas direções horizontal e vertical, respectivamente.

Aplica-se a

Confira também