Graphics.Clip プロパティとは? わかりやすく解説

Graphics.Clip プロパティ

この Graphics描画領域限定する Region取得または設定します

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

解説解説
使用例使用例

Clip プロパティ使用方法を示すコード例次に示します。この例は、Windows フォームでの使用意図してデザインされています。コードフォーム貼り付けフォームPaint イベント処理するときに PaintEventArgs の e渡して SetAndFillClip メソッド呼び出します。

Private Sub SetAndFillClip(ByVal
 e As PaintEventArgs)

    ' Set the Clip property to a new region.
    e.Graphics.Clip = New Region(New Rectangle(10,
 10, 100, 200))

    ' Fill the region.
    e.Graphics.FillRegion(Brushes.LightSalmon, e.Graphics.Clip)

    ' Demonstrate the clip region by drawing a string
    ' at the outer edge of the region.
    e.Graphics.DrawString("Outside of Clip", _
        New Font("Arial", 12.0F,
 FontStyle.Regular), _
        Brushes.Black, 0.0F, 0.0F)

End Sub
private void SetAndFillClip(PaintEventArgs
 e)
{

    // Set the Clip property to a new region.
    e.Graphics.Clip = new Region(new Rectangle(10,
 10, 100, 200));

    // Fill the region.
    e.Graphics.FillRegion(Brushes.LightSalmon, e.Graphics.Clip);

    // Demonstrate the clip region by drawing a string
    // at the outer edge of the region.
    e.Graphics.DrawString("Outside of Clip", new Font("Arial",
 
        12.0F, FontStyle.Regular), Brushes.Black, 0.0F, 0.0F);

}
private:
   void SetAndFillClip( PaintEventArgs^ e )
   {
      // Set the Clip property to a new region.
      e->Graphics->Clip = gcnew System::Drawing::Region( Rectangle(10,10,100,200)
 );

      // Fill the region.
      e->Graphics->FillRegion( Brushes::LightSalmon, e->Graphics->Clip
 );

      // Demonstrate the clip region by drawing a string
      // at the outer edge of the region.
      e->Graphics->DrawString( "Outside of Clip", gcnew System::Drawing::Font(
 "Arial",12.0F,FontStyle::Regular ), Brushes::Black, 0.0F, 0.0F );
   }
private void SetAndFillClip(PaintEventArgs
 e)
{
    // Set the Clip property to a new region.
    e.get_Graphics().set_Clip(new Region(new
 Rectangle(10, 10, 100, 200)));

    // Fill the region.
    e.get_Graphics().FillRegion(Brushes.get_LightSalmon(),
        e.get_Graphics().get_Clip());

    // Demonstrate the clip region by drawing a string
    // at the outer edge of the region.
    e.get_Graphics().DrawString("Outside of Clip", 
        new Font("Arial", 12, FontStyle.Regular), 
        Brushes.get_Black(), 0, 0);
} //SetAndFillClip
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphics.Clip プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphics.Clip プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphics.Clip プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Graphics.Clip プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Graphics.Clip プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS