Class HatchBrush
Namespace: Aspose.Imaging.Brushes
Assembly: Aspose.Imaging.dll (25.2.0)
Bir hatch stili, bir ön plan rengi ve bir arka plan rengi ile dikdörtgen bir fırça tanımlar. Bu sınıf miras alınamaz.
[JsonObject(MemberSerialization.OptIn)]
public sealed class HatchBrush : Brush, IDisposable
Miras
object ← DisposableObject ← Brush ← HatchBrush
Uygular
Miras Alınan Üyeler
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()
Örnekler
Bu örnek, Pen nesnelerinin oluşturulmasını ve kullanılmasını gösterir. Örnek, yeni bir Resim oluşturur ve Resim yüzeyine Dikdörtgenler çizer.```csharp [C#]
//BmpOptions nesnesinin bir örneğini oluşturun ve çeşitli özelliklerini ayarlayın
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//FileCreateSource nesnesinin bir örneğini oluşturun ve bunu BmpOptions örneği için Kaynak olarak atayın
//İkinci Boolean parametre, oluşturulacak dosyanın Geçici olup olmadığını belirler
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Belirtilen Yolda bir Resim nesnesi oluşturun
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Graphics nesnesinin bir örneğini oluşturun ve onu Resim nesnesi ile başlatın
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Grafik yüzeyini Beyaz Renk ile temizleyin
graphics.Clear(Aspose.Imaging.Color.White);
//Kırmızı renk ve 5 genişliğinde bir Pen nesnesi oluşturun
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//HatchBrush nesnesinin bir örneğini oluşturun ve özelliklerini ayarlayın
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Bir Pen nesnesi oluşturun
//HatchBrush nesnesi ve genişlik ile başlatın
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Pen nesnesini belirterek Dikdörtgenler çizin
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))
});
//Pen nesnesini belirterek Dikdörtgenler çizin
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))
});
// Tüm değişiklikleri kaydedin.
image.Save();
}
## Yapıcılar
### <a id="Aspose_Imaging_Brushes_HatchBrush__ctor"></a> HatchBrush\(\)
```csharp
public HatchBrush()
Özellikler
BackgroundColor
Hatch çizgileri arasındaki boşlukların rengini alır veya ayarlar.
public Color BackgroundColor { get; set; }
Özellik Değeri
Örnekler
Bu örnek, Pen nesnelerinin oluşturulmasını ve kullanılmasını gösterir. Örnek, yeni bir Resim oluşturur ve Resim yüzeyine Dikdörtgenler çizer.```csharp [C#]
//BmpOptions nesnesinin bir örneğini oluşturun ve çeşitli özelliklerini ayarlayın
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//FileCreateSource nesnesinin bir örneğini oluşturun ve bunu BmpOptions örneği için Kaynak olarak atayın
//İkinci Boolean parametre, oluşturulacak dosyanın Geçici olup olmadığını belirler
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Belirtilen Yolda bir Resim nesnesi oluşturun
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Graphics nesnesinin bir örneğini oluşturun ve onu Resim nesnesi ile başlatın
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Grafik yüzeyini Beyaz Renk ile temizleyin
graphics.Clear(Aspose.Imaging.Color.White);
//Kırmızı renk ve 5 genişliğinde bir Pen nesnesi oluşturun
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//HatchBrush nesnesinin bir örneğini oluşturun ve özelliklerini ayarlayın
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Bir Pen nesnesi oluşturun
//HatchBrush nesnesi ve genişlik ile başlatın
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Pen nesnesini belirterek Dikdörtgenler çizin
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))
});
//Pen nesnesini belirterek Dikdörtgenler çizin
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))
});
// Tüm değişiklikleri kaydedin.
image.Save();
}
### <a id="Aspose_Imaging_Brushes_HatchBrush_ForegroundColor"></a> ForegroundColor
Hatch çizgilerinin rengini alır veya ayarlar.
```csharp
public Color ForegroundColor { get; set; }
Özellik Değeri
Örnekler
Bu örnek, Pen nesnelerinin oluşturulmasını ve kullanılmasını gösterir. Örnek, yeni bir Resim oluşturur ve Resim yüzeyine Dikdörtgenler çizer.```csharp [C#]
//BmpOptions nesnesinin bir örneğini oluşturun ve çeşitli özelliklerini ayarlayın
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//FileCreateSource nesnesinin bir örneğini oluşturun ve bunu BmpOptions örneği için Kaynak olarak atayın
//İkinci Boolean parametre, oluşturulacak dosyanın Geçici olup olmadığını belirler
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Belirtilen Yolda bir Resim nesnesi oluşturun
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Graphics nesnesinin bir örneğini oluşturun ve onu Resim nesnesi ile başlatın
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Grafik yüzeyini Beyaz Renk ile temizleyin
graphics.Clear(Aspose.Imaging.Color.White);
//Kırmızı renk ve 5 genişliğinde bir Pen nesnesi oluşturun
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//HatchBrush nesnesinin bir örneğini oluşturun ve özelliklerini ayarlayın
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Bir Pen nesnesi oluşturun
//HatchBrush nesnesi ve genişlik ile başlatın
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Pen nesnesini belirterek Dikdörtgenler çizin
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))
});
//Pen nesnesini belirterek Dikdörtgenler çizin
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))
});
// Tüm değişiklikleri kaydedin.
image.Save();
}
### <a id="Aspose_Imaging_Brushes_HatchBrush_HatchStyle"></a> HatchStyle
Bu fırçanın hatch stilini alır veya ayarlar.
```csharp
public HatchStyle HatchStyle { get; set; }