Class SolidBrush
Namespace: Aspose.Imaging.Brushes
Assembly: Aspose.Imaging.dll (25.2.0)
Solid fırça, belirli bir renkle sürekli çizim yapmak için tasarlanmıştır. Bu sınıf miras alınamaz.
public sealed class SolidBrush : Brush, IDisposable
Miras
object ← DisposableObject ← Brush ← SolidBrush
Uygulamalar
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, Graphics sınıfını kullanarak Görüntü yüzeyinde ilkel şekiller oluşturur. İşlemi göstermek için, örnek yeni bir PNG formatında Görüntü oluşturur ve Graphics sınıfı tarafından sağlanan Çizim yöntemlerini kullanarak Görüntü yüzeyinde ilkel şekiller çizer.```csharp [C#]
//FileStream örneği oluşturur
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//PngOptions örneği oluşturur ve çeşitli özelliklerini ayarlar
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//PngOptions için Kaynağı ayarla
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Görüntü örneği oluştur
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Graphics sınıfının bir örneğini oluştur ve başlat
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Graphics yüzeyini temizle
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Siyah renkte Pen nesnesi belirterek bir Yay çiz
//Yayın etrafında bir Dikdörtgen, Başlangıç Açısı ve Süpürme Açısı
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Mavi renkte Pen nesnesi belirterek bir Bezier çiz
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Yeşil renkte Pen nesnesi belirterek bir Eğri çiz
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Pen nesnesi ve çevresindeki Dikdörtgen kullanarak bir Elips çiz
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Bir Çizgi çiz
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Bir Pasta dilimi çiz
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Kırmızı renkte Pen nesnesi belirterek bir Çokgen çiz
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Bir Dikdörtgen çiz
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Bir SolidBrush nesnesi oluştur ve çeşitli özelliklerini ayarla
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//SolidBrush nesnesi ve Font kullanarak belirli bir Noktada bir Dize çiz
graphics.DrawString("Bu görüntü Aspose.Imaging API ile oluşturulmuştur", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
//tüm değişiklikleri kaydet.
image.Save();
}
}
## Yapıcılar
### <a id="Aspose_Imaging_Brushes_SolidBrush__ctor"></a> SolidBrush\(\)
Aspose.Imaging.Brushes.SolidBrush sınıfının yeni bir örneğini başlatır.
```csharp
public SolidBrush()
Örnekler
Bu örnek, Graphics sınıfını kullanarak Görüntü yüzeyinde ilkel şekiller oluşturur. İşlemi göstermek için, örnek yeni bir PNG formatında Görüntü oluşturur ve Graphics sınıfı tarafından sağlanan Çizim yöntemlerini kullanarak Görüntü yüzeyinde ilkel şekiller çizer.```csharp [C#]
//FileStream örneği oluşturur
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//PngOptions örneği oluşturur ve çeşitli özelliklerini ayarlar
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//PngOptions için Kaynağı ayarla
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Görüntü örneği oluştur
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Graphics sınıfının bir örneğini oluştur ve başlat
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Graphics yüzeyini temizle
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Siyah renkte Pen nesnesi belirterek bir Yay çiz
//Yayın etrafında bir Dikdörtgen, Başlangıç Açısı ve Süpürme Açısı
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Mavi renkte Pen nesnesi belirterek bir Bezier çiz
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Yeşil renkte Pen nesnesi belirterek bir Eğri çiz
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Pen nesnesi ve çevresindeki Dikdörtgen kullanarak bir Elips çiz
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Bir Çizgi çiz
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Bir Pasta dilimi çiz
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Kırmızı renkte Pen nesnesi belirterek bir Çokgen çiz
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Bir Dikdörtgen çiz
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Bir SolidBrush nesnesi oluştur ve çeşitli özelliklerini ayarla
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//SolidBrush nesnesi ve Font kullanarak belirli bir Noktada bir Dize çiz
graphics.DrawString("Bu görüntü Aspose.Imaging API ile oluşturulmuştur", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
//tüm değişiklikleri kaydet.
image.Save();
}
}
### <a id="Aspose_Imaging_Brushes_SolidBrush__ctor_Aspose_Imaging_Color_"></a> SolidBrush\(Color\)
Aspose.Imaging.Brushes.SolidBrush sınıfının yeni bir örneğini başlatır.
```csharp
public SolidBrush(Color color)
Parametreler
color
Color
Solid fırça rengi.
Özellikler
Color
Fırça rengini alır veya ayarlar.
[JsonProperty]
public Color Color { get; set; }
Özellik Değeri
Örnekler
Bu örnek, Graphics sınıfını kullanarak Görüntü yüzeyinde ilkel şekiller oluşturur. İşlemi göstermek için, örnek yeni bir PNG formatında Görüntü oluşturur ve Graphics sınıfı tarafından sağlanan Çizim yöntemlerini kullanarak Görüntü yüzeyinde ilkel şekiller çizer.```csharp [C#]
//FileStream örneği oluşturur
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//PngOptions örneği oluşturur ve çeşitli özelliklerini ayarlar
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//PngOptions için Kaynağı ayarla
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Görüntü örneği oluştur
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Graphics sınıfının bir örneğini oluştur ve başlat
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Graphics yüzeyini temizle
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Siyah renkte Pen nesnesi belirterek bir Yay çiz
//Yayın etrafında bir Dikdörtgen, Başlangıç Açısı ve Süpürme Açısı
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Mavi renkte Pen nesnesi belirterek bir Bezier çiz
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Yeşil renkte Pen nesnesi belirterek bir Eğri çiz
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Pen nesnesi ve çevresindeki Dikdörtgen kullanarak bir Elips çiz
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Bir Çizgi çiz
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Bir Pasta dilimi çiz
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Kırmızı renkte Pen nesnesi belirterek bir Çokgen çiz
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Bir Dikdörtgen çiz
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Bir SolidBrush nesnesi oluştur ve çeşitli özelliklerini ayarla
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//SolidBrush nesnesi ve Font kullanarak belirli bir Noktada bir Dize çiz
graphics.DrawString("Bu görüntü Aspose.Imaging API ile oluşturulmuştur", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
//tüm değişiklikleri kaydet.
image.Save();
}
}