Graphics.Clip プロパティ
アセンブリ: System.Drawing (system.drawing.dll 内)

この Graphics のうち、現在描画に使用できる部分を限定する Region。


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

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGraphics.Clip プロパティを検索する場合は、下記のリンクをクリックしてください。

- Graphics.Clip プロパティのページへのリンク