この
Graphics の垂直方向の解像度を取得します。
名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
Public ReadOnly Property DpiY As Single
Dim instance As Graphics
Dim value As Single
value = instance.DpiY
public float DpiY { get; }
public:
property float DpiY {
float get ();
}
/** @property */
public float get_DpiY ()
public function get DpiY () : float
プロパティ値
この Graphics でサポートされる垂直方向の解像度の値 (dpi)。
DpiX プロパティと DpiY プロパティを使用する例を次のメソッドに示します。この例は、Windows フォームでの使用を意図してデザインされています。この例を実行するには、コードを listBox1 という名前の ListBox が含まれているフォームに貼り付け、フォームのコンストラクタからこのメソッドを呼び出します。
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
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:
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.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