TextureBrush::Clone Method ()
.NET Framework (current version)
Creates an exact copy of this TextureBrush object.
Assembly: System.Drawing (in System.Drawing.dll)
Return Value
Type: System::Object^The TextureBrush object this method creates, cast as an Object object.
Implements
ICloneable::Clone()The following example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code creates a TextureBrush object and an exact copy of that texture brush, and then uses the copy to fill a rectangle on the screen.
public: void Clone_Example( PaintEventArgs^ e ) { // Create a TextureBrush object. TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) ); // Create an exact copy of tBrush. TextureBrush^ cloneBrush = dynamic_cast<TextureBrush^>(tBrush->Clone()); // Fill a rectangle with cloneBrush. e->Graphics->FillRectangle( cloneBrush, 0, 0, 100, 100 ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: