TextureBrush::WrapMode Property

 

Gets or sets a WrapMode enumeration that indicates the wrap mode for this TextureBrush object.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public:
property WrapMode WrapMode {
	WrapMode get();
	void set(WrapMode value);
}

Property Value

Type: System.Drawing.Drawing2D::WrapMode

A WrapMode enumeration that specifies how fills drawn by using this LinearGradientBrush object are tiled.

The following code example demonstrates how to obtain a new bitmap using the FromFile method. It also demonstrates the WrapMode property 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:
   void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      try
      {
         Bitmap^ image1 = dynamic_cast<Bitmap^>(Image::FromFile( "C:\\Documents and Settings\\"
         "All Users\\Documents\\My Music\\music.bmp", true ));
         TextureBrush^ texture = gcnew TextureBrush( image1 );
         texture->WrapMode = System::Drawing::Drawing2D::WrapMode::Tile;
         Graphics^ formGraphics = this->CreateGraphics();
         formGraphics->FillEllipse( texture, RectangleF(90.0F,110.0F,100,100) );
         delete formGraphics;
      }
      catch ( System::IO::FileNotFoundException^ ) 
      {
         MessageBox::Show( "There was an error opening the bitmap."
         "Please check the path." );
      }
   }

.NET Framework
Available since 1.1
Return to top
Show: