Region.MakeInfinite メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)


MakeInfinite メソッドを使用する方法を次のコード例に示します。この例は、Windows フォームでの使用を意図してデザインされています。フォームを作成し、次のコードを貼り付けます。フォームの Paint イベント処理メソッドで FillEmptyRegion メソッドを呼び出し、e を PaintEventArgs として渡します。
Private Sub FillInfiniteRegion(ByVal e As PaintEventArgs) ' Create a region from a rectangle. Dim originalRectangle As New Rectangle(40, 40, 40, 50) Dim smallRegion As New Region(originalRectangle) ' Call MakeInfinite. smallRegion.MakeInfinite() ' Fill the region in red and draw the original rectangle ' in black. Note that the entire form is filled in. e.Graphics.FillRegion(Brushes.Red, smallRegion) e.Graphics.DrawRectangle(Pens.Black, originalRectangle) End Sub
private void FillInfiniteRegion(PaintEventArgs e) { // Create a region from a rectangle. Rectangle originalRectangle = new Rectangle(40, 40, 40, 50); Region smallRegion = new Region(originalRectangle); // Call MakeInfinite. smallRegion.MakeInfinite(); // Fill the region in red and draw the original rectangle // in black. Note that the entire form is filled in. e.Graphics.FillRegion(Brushes.Red, smallRegion); e.Graphics.DrawRectangle(Pens.Black, originalRectangle); }
private: void FillInfiniteRegion( PaintEventArgs^ e ) { // Create a region from a rectangle. Rectangle originalRectangle = Rectangle(40,40,40,50); System::Drawing::Region^ smallRegion = gcnew System::Drawing::Region( originalRectangle ); // Call MakeInfinite. smallRegion->MakeInfinite(); // Fill the region in red and draw the original rectangle // in black. Note that the entire form is filled in. e->Graphics->FillRegion( Brushes::Red, smallRegion ); e->Graphics->DrawRectangle( Pens::Black, originalRectangle ); }
private void FillInfiniteRegion(PaintEventArgs e) { // Create a region from a rectangle. Rectangle originalRectangle = new Rectangle(40, 40, 40, 50); Region smallRegion = new Region(originalRectangle); // Call MakeInfinite. smallRegion.MakeInfinite(); // Fill the region in red and draw the original rectangle // in black. Note that the entire form is filled in. e.get_Graphics().FillRegion(Brushes.get_Red(), smallRegion); e.get_Graphics().DrawRectangle(Pens.get_Black(), originalRectangle); } //FillInfiniteRegion

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


- Region.MakeInfinite メソッドのページへのリンク