Class HatchBrush

Class HatchBrush

De naam: Aspose.Imaging.Brushes Verzameling: Aspose.Imaging.dll (25.4.0)

Definieert een rectangular brush met een hatch stijl, een voorgrondkleur en een achtergrondkleur.

[JsonObject(MemberSerialization.OptIn)]
public sealed class HatchBrush : Brush, IDisposable

Inheritance

object DisposableObject Brush HatchBrush

Implements

IDisposable

Geëerbiede leden

Brush.DeepClone() , Brush.Equals(object) , Brush.GetHashCode() , Brush.Opacity , DisposableObject.Dispose() , DisposableObject.Disposed , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Dit voorbeeld toont de creatie en het gebruik van Pen objecten.Het voorwerp creëert een nieuw beeld en draagt Rectangles op de oppervlakte van het beeld.

//Create an instance of BmpOptions and set its various properties
                                                                                                                                       Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
                                                                                                                                       bmpOptions.BitsPerPixel = 24;

                                                                                                                                       //Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
                                                                                                                                       //Second Boolean parameter determines if the file to be created IsTemporal or not
                                                                                                                                       bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);

                                                                                                                                       //Create an instance of Image at specified Path
                                                                                                                                       using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
                                                                                                                                       {
                                                                                                                                           //Create an instance of Graphics and initialize it with Image object
                                                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                           //Clear the Graphics sutface with White Color
                                                                                                                                           graphics.Clear(Aspose.Imaging.Color.White);

                                                                                                                                           //Create an instance of Pen with color Red and width 5
                                                                                                                                           Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);

                                                                                                                                           //Create an instance of HatchBrush and set its properties
                                                                                                                                           Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
                                                                                                                                           brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
                                                                                                                                           brush.ForegroundColor = Aspose.Imaging.Color.Red;

                                                                                                                                           //Create an instance of Pen
                                                                                                                                           //initialize it with HatchBrush object and width
                                                                                                                                           Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(pen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(brusedpen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           // save all changes.
                                                                                                                                           image.Save();
                                                                                                                                       }

Constructors

HatchBrush()

public HatchBrush()

Properties

BackgroundColor

Geeft of zet de kleur van de ruimtes tussen de hatchlijnen.

public Color BackgroundColor { get; set; }

Eigendomswaarde

Color

Examples

Dit voorbeeld toont de creatie en het gebruik van Pen objecten.Het voorwerp creëert een nieuw beeld en draagt Rectangles op de oppervlakte van het beeld.

//Create an instance of BmpOptions and set its various properties
                                                                                                                                       Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
                                                                                                                                       bmpOptions.BitsPerPixel = 24;

                                                                                                                                       //Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
                                                                                                                                       //Second Boolean parameter determines if the file to be created IsTemporal or not
                                                                                                                                       bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);

                                                                                                                                       //Create an instance of Image at specified Path
                                                                                                                                       using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
                                                                                                                                       {
                                                                                                                                           //Create an instance of Graphics and initialize it with Image object
                                                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                           //Clear the Graphics sutface with White Color
                                                                                                                                           graphics.Clear(Aspose.Imaging.Color.White);

                                                                                                                                           //Create an instance of Pen with color Red and width 5
                                                                                                                                           Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);

                                                                                                                                           //Create an instance of HatchBrush and set its properties
                                                                                                                                           Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
                                                                                                                                           brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
                                                                                                                                           brush.ForegroundColor = Aspose.Imaging.Color.Red;

                                                                                                                                           //Create an instance of Pen
                                                                                                                                           //initialize it with HatchBrush object and width
                                                                                                                                           Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(pen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(brusedpen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           // save all changes.
                                                                                                                                           image.Save();
                                                                                                                                       }

ForegroundColor

Geeft of zet de kleur van de hatchlijnen.

public Color ForegroundColor { get; set; }

Eigendomswaarde

Color

Examples

Dit voorbeeld toont de creatie en het gebruik van Pen objecten.Het voorwerp creëert een nieuw beeld en draagt Rectangles op de oppervlakte van het beeld.

//Create an instance of BmpOptions and set its various properties
                                                                                                                                       Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
                                                                                                                                       bmpOptions.BitsPerPixel = 24;

                                                                                                                                       //Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
                                                                                                                                       //Second Boolean parameter determines if the file to be created IsTemporal or not
                                                                                                                                       bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);

                                                                                                                                       //Create an instance of Image at specified Path
                                                                                                                                       using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
                                                                                                                                       {
                                                                                                                                           //Create an instance of Graphics and initialize it with Image object
                                                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                           //Clear the Graphics sutface with White Color
                                                                                                                                           graphics.Clear(Aspose.Imaging.Color.White);

                                                                                                                                           //Create an instance of Pen with color Red and width 5
                                                                                                                                           Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);

                                                                                                                                           //Create an instance of HatchBrush and set its properties
                                                                                                                                           Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
                                                                                                                                           brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
                                                                                                                                           brush.ForegroundColor = Aspose.Imaging.Color.Red;

                                                                                                                                           //Create an instance of Pen
                                                                                                                                           //initialize it with HatchBrush object and width
                                                                                                                                           Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(pen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(brusedpen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           // save all changes.
                                                                                                                                           image.Save();
                                                                                                                                       }

HatchStyle

Geeft of zet de hatch-stijl van deze borstel.

public HatchStyle HatchStyle { get; set; }

Eigendomswaarde

HatchStyle

 Nederlands