.NET Framework クラス ライブラリ
Graphics.DpiY プロパティ

この Graphics の垂直方向の解像度を取得します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)

構文

Visual Basic (宣言)
Public ReadOnly Property DpiY As Single
Visual Basic (使用法)
Dim instance As Graphics
Dim value As Single

value = instance.DpiY
C#
public float DpiY { get; }
C++
public:
property float DpiY {
    float get ();
}
J#
/** @property */
public float get_DpiY ()
JScript
public function get DpiY () : float

プロパティ値

この Graphics でサポートされる垂直方向の解像度の値 (dpi)。
使用例

DpiX プロパティと DpiY プロパティを使用する例を次のメソッドに示します。この例は、Windows フォームでの使用を意図してデザインされています。この例を実行するには、コードを listBox1 という名前の ListBox が含まれているフォームに貼り付け、フォームのコンストラクタからこのメソッドを呼び出します。

Visual Basic
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
C#
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();
}
C++
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;
   }
J#
private void PopulateListBoxWithGraphicsResolution()
{
    Graphics boxGraphics = listBox1.CreateGraphics();
    Graphics formGraphics = this.CreateGraphics();

    listBox1.get_Items().Add(("ListBox horizontal resolution: " 
        + boxGraphics.get_DpiX()));
    listBox1.get_Items().Add(("ListBox vertical resolution: " 
        + boxGraphics.get_DpiY()));
    boxGraphics.Dispose();
} //PopulateListBoxWithGraphicsResolution
プラットフォーム

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

.NET Compact Framework

サポート対象 : 2.0
参照

タグ :


Page view tracker