Graphics.DpiY Eigenschaft

Definition

Ruft die vertikale Auflösung dieses GraphicsAb.

public:
 property float DpiY { float get(); };
public float DpiY { get; }
member this.DpiY : single
Public ReadOnly Property DpiY As Single

Eigenschaftswert

Der Wert in Punkten pro Zoll für die vertikale Auflösung, die von diesem Graphicsunterstützt wird.

Beispiele

Die folgende Methode zeigt die Verwendung der Eigenschaften und DpiX deren DpiY Verwendung. Dieses Beispiel wurde für die Verwendung mit einem Windows Formular entwickelt. Um dieses Beispiel auszuführen, fügen Sie es in ein Formular ein, das ein benanntes ListBox ListBox1 enthält, und rufen Sie diese Methode aus dem Konstruktor des Formulars auf.

private:
   void PopulateListBoxWithGraphicsResolution()
   {
      Graphics^ boxGraphics = listBox1->CreateGraphics();

      // Graphics* formGraphics = this->CreateGraphics();
      listBox1->Items->Add( String::Format( "ListBox horizontal resolution: {0}", boxGraphics->DpiX ) );
      listBox1->Items->Add( String::Format( "ListBox vertical resolution: {0}", boxGraphics->DpiY ) );
      delete boxGraphics;
   }
private void PopulateListBoxWithGraphicsResolution()
{
    Graphics boxGraphics = listBox1.CreateGraphics();
    Graphics formGraphics = this.CreateGraphics();

    listBox1.Items.Add("ListBox horizontal resolution: " 
        + boxGraphics.DpiX);
    listBox1.Items.Add("ListBox vertical resolution: " 
        + boxGraphics.DpiY);

    boxGraphics.Dispose();
}
Private Sub PopulateListBoxWithGraphicsResolution()
    Dim boxGraphics As Graphics = listBox1.CreateGraphics()
    Dim formGraphics As Graphics = Me.CreateGraphics()

    listBox1.Items.Add("ListBox horizontal resolution: " _
        & boxGraphics.DpiX)
    listBox1.Items.Add("ListBox vertical resolution: " _
        & boxGraphics.DpiY)

    boxGraphics.Dispose()
End Sub

Hinweise

Weitere Informationen zum Erstellen von hochauflösenden Anwendungen finden Sie unter

Hoher DPI-Wert.

Gilt für:

Weitere Informationen