WrapMode Enumeration
Specifies how a texture or gradient is tiled when it is smaller than the area being filled.
Assembly: System.Drawing (in System.Drawing.dll)
| Member name | Description | |
|---|---|---|
| Tile | Tiles the gradient or texture. | |
| TileFlipX | Reverses the texture or gradient horizontally and then tiles the texture or gradient. | |
| TileFlipY | Reverses the texture or gradient vertically and then tiles the texture or gradient. | |
| TileFlipXY | Reverses the texture or gradient horizontally and vertically and then tiles the texture or gradient. | |
| Clamp | The texture or gradient is not tiled. |
Brushes use this enumeration to determine how shapes are filled. To see examples of the effects the WrapMode enumeration values have on a tiled image, see How to: Tile a Shape with an Image.
The following code example demonstrates how to obtain a new bitmap using the FromFile method. It also demonstrates a TextureBrush and the WrapMode enumeration. This example is designed to be used with Windows Forms. Create a form containing a button named Button2. Paste the code into the form and associate the Button2_Click method with the button's Click event.
Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click Try Dim image1 As Bitmap = _ CType(Image.FromFile("C:\Documents and Settings\" _ & "All Users\Documents\My Music\music.bmp", True), Bitmap) Dim texture As New TextureBrush(image1) texture.WrapMode = Drawing2D.WrapMode.Tile Dim formGraphics As Graphics = Me.CreateGraphics() formGraphics.FillEllipse(texture, _ New RectangleF(90.0F, 110.0F, 100, 100)) formGraphics.Dispose() Catch ex As System.IO.FileNotFoundException MessageBox.Show("There was an error opening the bitmap." _ & "Please check the path.") End Try End Sub
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.