Class Brush

Class Brush

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)

فئة الفرشاة الأساسية.

[JsonObject(MemberSerialization.OptIn)]
public abstract class Brush : DisposableObject, IDisposable

الوراثة

objectDisposableObjectBrush

المشتقات

HatchBrush, SolidBrush, TransformBrush

التنفيذ

IDisposable

الأعضاء الموروثة

DisposableObject.Dispose(), DisposableObject.ReleaseManagedResources(), DisposableObject.ReleaseUnmanagedResources(), DisposableObject.VerifyNotDisposed(), DisposableObject.Disposed, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

المنشئات

Brush()

protected Brush()

الخصائص

Opacity

يحصل أو يحدد شفافية الفرشاة. يجب أن تكون القيمة بين 0 و 1. قيمة 0 تعني أن الفرشاة مرئية بالكامل، وقيمة 1 تعني أن الفرشاة غير شفافة بالكامل.

public float Opacity { get; set; }

قيمة الخاصية

float

أمثلة

يستخدم هذا المثال فئة Graphics لإنشاء أشكال بدائية على سطح الصورة. لإظهار العملية، يقوم المثال بإنشاء صورة جديدة بتنسيق PNG ورسم أشكال بدائية على سطح الصورة باستخدام طرق Draw التي تعرضها فئة Graphics```csharp [C#]

                                                                                                                                                                                                                                                            //ينشئ مثيلًا من FileStream
                                                                                                                                                                                                                                                            using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
                                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                                //إنشاء مثيل من PngOptions وتعيين خصائصه المختلفة
                                                                                                                                                                                                                                                                Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();

                                                                                                                                                                                                                                                                //تعيين المصدر لـ PngOptions
                                                                                                                                                                                                                                                                pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);

                                                                                                                                                                                                                                                                //إنشاء مثيل من الصورة 
                                                                                                                                                                                                                                                                using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                    //إنشاء وتهيئة مثيل من فئة Graphics
                                                                                                                                                                                                                                                                    Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                                                                                                                                                    //مسح سطح الرسومات
                                                                                                                                                                                                                                                                    graphics.Clear(Aspose.Imaging.Color.Wheat);

                                                                                                                                                                                                                                                                    //رسم قوس عن طريق تحديد كائن القلم بلون أسود، 
                                                                                                                                                                                                                                                                    //مستطيل يحيط بالقوس، زاوية البداية وزاوية السحب
                                                                                                                                                                                                                                                                    graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);

                                                                                                                                                                                                                                                                    //رسم بيزير عن طريق تحديد كائن القلم بلون أزرق ونقاط الإحداثيات.
                                                                                                                                                                                                                                                                    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));

                                                                                                                                                                                                                                                                    //رسم منحنى عن طريق تحديد كائن القلم بلون أخضر ومصفوفة من النقاط
                                                                                                                                                                                                                                                                    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) });

                                                                                                                                                                                                                                                                    //رسم بيضة باستخدام كائن القلم ومستطيل يحيط بها
                                                                                                                                                                                                                                                                    graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));

                                                                                                                                                                                                                                                                    //رسم خط 
                                                                                                                                                                                                                                                                    graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));

                                                                                                                                                                                                                                                                    //رسم شريحة فطيرة
                                                                                                                                                                                                                                                                    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);

                                                                                                                                                                                                                                                                    //رسم مضلع عن طريق تحديد كائن القلم بلون أحمر ومصفوفة من النقاط
                                                                                                                                                                                                                                                                    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) });

                                                                                                                                                                                                                                                                    //رسم مستطيل
                                                                                                                                                                                                                                                                    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)));

                                                                                                                                                                                                                                                                    //إنشاء كائن SolidBrush وتعيين خصائصه المختلفة
                                                                                                                                                                                                                                                                    Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
                                                                                                                                                                                                                                                                    brush.Color = Color.Purple;
                                                                                                                                                                                                                                                                    brush.Opacity = 100;

                                                                                                                                                                                                                                                                    //رسم سلسلة باستخدام كائن SolidBrush وخط، عند نقطة معينة
                                                                                                                                                                                                                                                                    graphics.DrawString("تم إنشاء هذه الصورة بواسطة واجهة برمجة تطبيقات Aspose.Imaging", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));

                                                                                                                                                                                                                                                                    // حفظ جميع التغييرات.
                                                                                                                                                                                                                                                                    image.Save();
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                            }

## الطرق

### <a id="Aspose_Imaging_Brush_DeepClone"></a> DeepClone\(\)

يخلق نسخة عميقة جديدة من Aspose.Imaging.Brush الحالية.

```csharp
public virtual Brush DeepClone()

العائدات

Brush

نسخة جديدة من Aspose.Imaging.Brush والتي هي النسخة العميقة من هذه النسخة من Aspose.Imaging.Brush.

Equals(object)

تحقق مما إذا كانت الكائنات متساوية.

public override bool Equals(object obj)

المعلمات

obj object

الكائن الآخر.

العائدات

bool

نتيجة مقارنة المساواة.

Equals(Brush)

تحقق مما إذا كانت الكائنات متساوية.

protected bool Equals(Brush other)

المعلمات

other Brush

الكائن الآخر.

العائدات

bool

نتيجة مقارنة المساواة.

GetHashCode()

احصل على رمز التجزئة للكائن الحالي.

public override int GetHashCode()

العائدات

int

رمز التجزئة.

 عربي