SystemIcons クラス
アセンブリ: System.Drawing (system.drawing.dll 内)


GraphicsUnit 列挙体を使用して、ビットマップを Icon ハンドルから読み込み、Round メソッドを使用して、ビットマップの外接する四角形を描画するコード例を次に示します。
この例は、Windows フォームでの使用を意図してデザインされています。Button2 という名前のボタンを格納するフォームを作成します。コードをフォームに貼り付け、このメソッドをボタンの Click イベントに関連付けます。
Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click Dim bitmap1 As Bitmap = Bitmap.FromHicon(SystemIcons.Hand.Handle) Dim formGraphics As Graphics = Me.CreateGraphics() Dim units As GraphicsUnit = GraphicsUnit.Point Dim bmpRectangleF As RectangleF = bitmap1.GetBounds(units) Dim bmpRectangle As Rectangle = Rectangle.Round(bmpRectangleF) formGraphics.DrawRectangle(Pens.Blue, bmpRectangle) formGraphics.Dispose() End Sub
private void Button2_Click(System.Object sender, System.EventArgs e) { Bitmap bitmap1 = Bitmap.FromHicon(SystemIcons.Hand.Handle); Graphics formGraphics = this.CreateGraphics(); GraphicsUnit units = GraphicsUnit.Point; RectangleF bmpRectangleF = bitmap1.GetBounds(ref units); Rectangle bmpRectangle = Rectangle.Round(bmpRectangleF); formGraphics.DrawRectangle(Pens.Blue, bmpRectangle); formGraphics.Dispose(); }
void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ ) { Bitmap^ bitmap1 = Bitmap::FromHicon( SystemIcons::Hand->Handle ); Graphics^ formGraphics = this->CreateGraphics(); GraphicsUnit units = GraphicsUnit::Point; RectangleF bmpRectangleF = bitmap1->GetBounds( units ); Rectangle bmpRectangle = Rectangle::Round( bmpRectangleF ); formGraphics->DrawRectangle( Pens::Blue, bmpRectangle ); delete formGraphics; }
private void button2_Click(System.Object sender, System.EventArgs e) { Bitmap bitmap1 = Bitmap.FromHicon(SystemIcons.get_Hand().get_Handle()); Graphics formGraphics = this.CreateGraphics(); GraphicsUnit units = GraphicsUnit.Point; RectangleF bmpRectangleF = bitmap1.GetBounds(units); Rectangle bmpRectangle = Rectangle.Round(bmpRectangleF); formGraphics.DrawRectangle(Pens.get_Blue(), bmpRectangle); formGraphics.Dispose(); } //button2_Click

System.Drawing.SystemIcons


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSystemIcons クラスを検索する場合は、下記のリンクをクリックしてください。

- SystemIcons クラスのページへのリンク