Texturepacker exclude image
![texturepacker exclude image texturepacker exclude image](http://pixelscopic.com/wp-content/uploads/2013/09/tp_ss1.jpg)
Public Sub Exclude_RectF_Example(ByVal e As PaintEventArgs) SolidBrush myBrush = new SolidBrush(Color.Blue) Į.Graphics.FillRegion(myBrush, myRegion) Region myRegion = new Region(regionRect) RectangleF complementRect = new RectangleF(90, 30, 100, 100) Rectangle regionRect = new Rectangle(20, 20, 100, 100) Į.Graphics.DrawRectangle(Pens.Black, regionRect) Public void Exclude_RectF_Example(PaintEventArgs e) SolidBrush^ myBrush = gcnew SolidBrush( Color::Blue ) Į->Graphics->FillRegion( myBrush, myRegion ) Fill the nonexcluded area of myRegion with blue. Get the nonexcluded area of myRegion when combined with System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect ) Create a region using the first rectangle. RectangleF complementRect = RectangleF(90,30,100,100) Į->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( complementRect ) ) Create the second rectangle and draw it to the screen in red. Rectangle regionRect = Rectangle(20,20,100,100) Į->Graphics->DrawRectangle( Pens::Black, regionRect ) Create the first rectangle and draw it to the screen in black. Void Exclude_RectF_Example( PaintEventArgs^ e ) Notice that the area of the area of the region that does not intersect with the rectangle is colored blue. Gets the nonexcluded area of the region when combined with the second rectangle.įills the nonexcluded area with blue and draws it to the screen.
#Texturepacker exclude image code
The code performs the following actions:Ĭreates a rectangle and draws it to the screen in blackĬreates a second rectangle that intersects with the first and draws it to the screen in red.Ĭreates a region using the first rectangle.
#Texturepacker exclude image windows
The following example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The RectangleF structure to exclude from this Region. ' Dispose of the path and region objects.
![texturepacker exclude image texturepacker exclude image](https://image.shutterstock.com/image-photo/beige-carpet-texture-260nw-147105119.jpg)
' Retrieve a Graphics object from the form.ĭim formGraphics As Graphics = e.GraphicsįormGraphics.FillRegion(Brushes.Blue, myRegion) Private Sub FillRegionExcludingPath(ByVal e As PaintEventArgs)ĭim myRegion As New Region(New Rectangle(20, 20, 100, 100))ĭim path As New New () įormGraphics.FillRegion(Brushes.Blue, myRegion) Region myRegion = new Region(new Rectangle(20, 20, 100, 100)) Private void FillRegionExcludingPath(PaintEventArgs e) Dispose of the path and region objects. Retrieve a Graphics object from the form.įormGraphics->FillRegion( Brushes::Blue, myRegion ) System::Drawing::Drawing2D::GraphicsPath^ path = gcnew System::Drawing::Drawing2D::GraphicsPath System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( Rectangle(20,20,100,100) ) Void FillRegionExcludingPath( PaintEventArgs^ e ) Paste the code into a form and call the FillRegionExcludingPath method when handling the form's Paint event, passing e as PaintEventArgs. This example is designed to be used with Windows Forms. The following code example demonstrates the Region constructor and the Exclude and Dispose methods.