ImageAttributes.SetWrapMode メソッド (WrapMode, Color)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As ImageAttributes Dim mode As WrapMode Dim color As Color instance.SetWrapMode(mode, color)
- color
表示イメージの外側のピクセルの色を指定する ImageAttributes オブジェクト。モード パラメータが Clamp に設定され、DrawImage に渡されたソース四角形がそのイメージ自体より大きい場合に、この色が表示されます。
このメソッドは値を返しません。


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


ImageAttributes.SetWrapMode メソッド (WrapMode, Color, Boolean)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As ImageAttributes Dim mode As WrapMode Dim color As Color Dim clamp As Boolean instance.SetWrapMode(mode, color, clamp)
- color
表示イメージの外側のピクセルの色を指定する Color オブジェクト。モード パラメータが Clamp に設定され、DrawImage に渡されたソース四角形がそのイメージ自体より大きい場合に、この色が表示されます。
このメソッドは値を返しません。


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


ImageAttributes.SetWrapMode メソッド (WrapMode)
アセンブリ: System.Drawing (system.drawing.dll 内)


SetWrapMode(WrapMode) メソッドを呼び出すことは、SetWrapMode(WrapMode,Color) を呼び出し、color パラメータに Color.Black を渡すことと同等です。Color.Black は、表示イメージの外側のピクセルの色を指定します。モード パラメータが Clamp に設定され、DrawImage メソッドに渡されたソース四角形がそのイメージ自体より大きい場合に、この色が表示されます。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub SetWrapModeExample(ByVal e As PaintEventArgs) ' Create a filled, red circle, and save it to Circle3.jpg. Dim myBitmap As New Bitmap(50, 50) Dim g As Graphics = Graphics.FromImage(myBitmap) g.Clear(Color.White) g.FillEllipse(New SolidBrush(Color.Red), New Rectangle(0, 0, _ 25, 25)) myBitmap.Save("Circle3.jpg") ' Create an Image object from the Circle3.jpg file, and draw ' it to the screen. Dim myImage As Image = Image.FromFile("Circle3.jpg") e.Graphics.DrawImage(myImage, 20, 20) ' Set the wrap mode. Dim imageAttr As New ImageAttributes imageAttr.SetWrapMode(WrapMode.Tile) ' Create a TextureBrush. Dim brushRect As New Rectangle(0, 0, 25, 25) Dim myTBrush As New TextureBrush(myImage, brushRect, imageAttr) ' Draw to the screen a rectangle filled with red circles. e.Graphics.FillRectangle(myTBrush, 100, 20, 200, 200) End Sub
private void SetWrapModeExample(PaintEventArgs e) { // Create a filled, red circle, and save it to Circle3.jpg. Bitmap myBitmap = new Bitmap(50, 50); Graphics g = Graphics.FromImage(myBitmap); g.Clear(Color.White); g.FillEllipse(new SolidBrush(Color.Red), new Rectangle(0, 0, 25, 25)); myBitmap.Save("Circle3.jpg"); // Create an Image object from the Circle3.jpg file, and draw it // to the screen. Image myImage = Image.FromFile("Circle3.jpg"); e.Graphics.DrawImage(myImage, 20, 20); // Set the wrap mode. ImageAttributes imageAttr = new ImageAttributes(); imageAttr.SetWrapMode(WrapMode.Tile); // Create a TextureBrush. Rectangle brushRect = new Rectangle(0,0,25,25); TextureBrush myTBrush = new TextureBrush(myImage, brushRect, imageAttr); // Draw to the screen a rectangle filled with red circles. e.Graphics.FillRectangle(myTBrush, 100, 20, 200, 200); }
void SetWrapModeExample( PaintEventArgs^ e ) { // Create a filled, red circle, and save it to Circle3.jpg. Bitmap^ myBitmap = gcnew Bitmap( 50,50 ); Graphics^ g = Graphics::FromImage( myBitmap ); g->Clear( Color::White ); g->FillEllipse( gcnew SolidBrush( Color::Red ), Rectangle(0,0,25,25) ); myBitmap->Save( "Circle3.jpg" ); // Create an Image object from the Circle3.jpg file, and draw it // to the screen. Image^ myImage = Image::FromFile( "Circle3.jpg" ); e->Graphics->DrawImage( myImage, 20, 20 ); // Set the wrap mode. ImageAttributes^ imageAttr = gcnew ImageAttributes; imageAttr->SetWrapMode( WrapMode::Tile ); // Create a TextureBrush. Rectangle brushRect = Rectangle(0,0,25,25); TextureBrush^ myTBrush = gcnew TextureBrush( myImage,brushRect,imageAttr ); // Draw to the screen a rectangle filled with red circles. e->Graphics->FillRectangle( myTBrush, 100, 20, 200, 200 ); }
private void SetWrapModeExample(PaintEventArgs e) { // Create a filled, red circle, and save it to Circle3.jpg. Bitmap myBitmap = new Bitmap(50, 50); Graphics g = Graphics.FromImage(myBitmap); g.Clear(Color.get_White()); g.FillEllipse(new SolidBrush(Color.get_Red()), new Rectangle(0, 0, 25, 25)); myBitmap.Save("Circle3.jpg"); // Create an Image object from the Circle3.jpg file, and draw it // to the screen. Image myImage = Image.FromFile("Circle3.jpg"); e.get_Graphics().DrawImage(myImage, 20, 20); // Set the wrap mode. ImageAttributes imageAttr = new ImageAttributes(); imageAttr.SetWrapMode(WrapMode.Tile); // Create a TextureBrush. Rectangle brushRect = new Rectangle(0, 0, 25, 25); TextureBrush myTBrush = new TextureBrush(myImage, brushRect, imageAttr); // Draw to the screen a rectangle filled with red circles. e.get_Graphics().FillRectangle(myTBrush, 100, 20, 200, 200); } //SetWrapModeExample

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


ImageAttributes.SetWrapMode メソッド

名前 | 説明 |
---|---|
ImageAttributes.SetWrapMode (WrapMode) | 形状全体、または形状の境界上にテクスチャを並べて表示する方法を決定するために使用されるラップ モードを設定します。テクスチャで塗りつぶす形状がそのテクスチャより小さい場合、テクスチャは形状の境界をはみだして表示されます。 |
ImageAttributes.SetWrapMode (WrapMode, Color) | 形状全体、または形状の境界上にテクスチャを並べて表示する方法を決定するために使用される、ラップ モードおよび色を指定します。テクスチャで塗りつぶす形状がそのテクスチャより小さい場合、テクスチャは形状の境界をはみだして表示されます。 |
ImageAttributes.SetWrapMode (WrapMode, Color, Boolean) | 形状全体、または形状の境界上にテクスチャを並べて表示する方法を決定するために使用される、ラップ モードおよび色を指定します。テクスチャで塗りつぶす形状がそのテクスチャより小さい場合、テクスチャは形状の境界をはみだして表示されます。 |

- ImageAttributes.SetWrapMode メソッドのページへのリンク