Class Graphics
اسم الفضاء : Aspose.Imaging تجميع: Aspose.Imaging.dll (25.4.0)
يمثل الرسومات وفقا لمحرك الرسومات المستخدمة في التجميع الحالي.
public sealed class Graphics
Inheritance
الأعضاء الموروثين
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Constructors
Graphics(Image)
يبدأ مثالًا جديدًا من فئة Aspose.Imaging.Graphics.
public Graphics(Image sourceImage)
Parameters
sourceImage
Image
صورة المصدر .
Properties
Clip
احصل على أو وضع منطقة الكليب.
public Region Clip { get; set; }
قيمة الممتلكات
CompositingQuality
يحصل أو يحدد جودة التركيب.
public CompositingQuality CompositingQuality { get; set; }
قيمة الممتلكات
دبيكس
يحصل على القرار الأفقي لهذا Aspose.Imaging.Graphics.
public float DpiX { get; }
قيمة الممتلكات
دبي
يحصل على القرار الرأسي لهذا Aspose.Imaging.Graphics.
public float DpiY { get; }
قيمة الممتلكات
Image
احصل على الصورة
public Image Image { get; }
قيمة الممتلكات
InterpolationMode
يحصل أو يحدد وضع التفاعل.
public InterpolationMode InterpolationMode { get; set; }
قيمة الممتلكات
IsInBeginUpdateCall
يحصل على قيمة تشير إلى ما إذا كانت الرسومات موجودة في حالة الاتصال BeginUpdate.
public bool IsInBeginUpdateCall { get; }
قيمة الممتلكات
PageScale
يحصل أو يحدد التوسع بين وحدات العالم وحدات الصفحة لهذا Aspose.Imaging.Graphics.
public float PageScale { get; set; }
قيمة الممتلكات
PageUnit
يحصل أو يضع وحدة القياس المستخدمة في إحداثيات الصفحة في هذا Aspose.Imaging.Graphics.
public GraphicsUnit PageUnit { get; set; }
قيمة الممتلكات
PaintableImageOptions
يحصل أو يضع خيارات الصورة، المستخدمة لإنشاء صور الخرسانة الملونة للطلاء.
public ImageOptionsBase PaintableImageOptions { get; set; }
قيمة الممتلكات
SmoothingMode
يحصل أو يضع وضع التخفيف.
public SmoothingMode SmoothingMode { get; set; }
قيمة الممتلكات
TextRenderingHint
يحصل أو يضع نصًا يقدم نصًا.
public TextRenderingHint TextRenderingHint { get; set; }
قيمة الممتلكات
Transform
الحصول على أو وضع نسخة من التحول الجيومترية للعالم لهذا Aspose.Imaging.Graphics.
public Matrix Transform { get; set; }
قيمة الممتلكات
Methods
BeginUpdate()
لا يتم تطبيق تأثيرات الرسومات التي تم تطبيقها لاحقا على الفور بدلا من EndUpdate سوف يسبب تطبيق جميع التأثيرات في وقت واحد.
public void BeginUpdate()
Remarks
لاحظ التأثيرات بعد استدعاء BeginUpdate لن يتم تطبيقها إذا لم يتم استدعاء EndUpdate.
Clear(Color)
تنظيف سطح الرسومات باستخدام اللون المحدد.
public void Clear(Color color)
Parameters
color
Color
اللون لتنظيف سطح الرسومات.
Examples
هذه الأمثلة تستخدم فئة GraphicsPath و Graphics لإنشاء وتلاعب الأرقام على سطح الصورة. نموذج يخلق صورة جديدة (من نوع Tiff) ، ويطهر السطح ويسحب المسارات بمساعدة فئة GraphicsPath.
//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
//Create an instance of TiffOptions and set its various properties
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
//Set the source for the instance of ImageOptions
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();
//Create an instance of Figure class
Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);
// save all changes.
image.Save();
}
}
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
DrawArc(البلاط، البلاط، البلاط، البلاط، البلاط)
يقطع قوسًا يمثل جزءًا من الانحناء المحدد من قبل زوج من الإحداثيات ، وعرض ، وارتفاع.
public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب القوس.
x
float
منسق x من الزاوية العليا اليسرى من المستطيل الذي يحدد الانحناء.
y
float
ي-منسق الزاوية العليا اليسرى من المستطيل الذي يحدد الانحناء.
width
float
عرض المستطيل الذي يحدد الانحناء.
height
float
ارتفاع المستطيل الذي يحدد الانحناء.
startAngle
float
الزاوية في الدرجات قياس على نحو الساعة من محور x إلى نقطة البداية من القوس.
sweepAngle
float
زاوية في درجات قياس زاوية الساعة من معيار startAngle’ لإنهاء نقطة القوس.
Exceptions
pen’ is null.
DrawArc(القلم، القلم، القلم، القلم)
يقطع قوسًا يمثل جزءًا من الانحناء المحدد بواسطة بنية Aspose.Imaging.RectangleF.
public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب القوس.
rect
RectangleF
Aspose.Imaging.RectangleF الهيكل الذي يحدد حدود الانحناء.
startAngle
float
الزاوية في الدرجات قياس على نحو الساعة من محور x إلى نقطة البداية من القوس.
sweepAngle
float
زاوية في درجات قياس زاوية الساعة من معيار startAngle’ لإنهاء نقطة القوس.
Exceptions
pen’ is null
DrawArc(إنت، إنت، إنت، إنت، إنت، إنت)
يقطع قوسًا يمثل جزءًا من الانحناء المحدد من قبل زوج من الإحداثيات ، وعرض ، وارتفاع.
public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب القوس.
x
int
منسق x من الزاوية العليا اليسرى من المستطيل الذي يحدد الانحناء.
y
int
ي-منسق الزاوية العليا اليسرى من المستطيل الذي يحدد الانحناء.
width
int
عرض المستطيل الذي يحدد الانحناء.
height
int
ارتفاع المستطيل الذي يحدد الانحناء.
startAngle
int
الزاوية في الدرجات قياس على نحو الساعة من محور x إلى نقطة البداية من القوس.
sweepAngle
int
زاوية في درجات قياس زاوية الساعة من معيار startAngle’ لإنهاء نقطة القوس.
Exceptions
pen’ is null.
DrawArc(قوس قزح، قوس قزح، قوس قزح)
يقطع قوسًا يمثل جزءًا من الإليبس المحدد بواسطة بنية Aspose.Imaging.Rectangle.
public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب القوس.
rect
Rectangle
Aspose.Imaging.RectangleF الهيكل الذي يحدد حدود الانحناء.
startAngle
float
الزاوية في الدرجات قياس على نحو الساعة من محور x إلى نقطة البداية من القوس.
sweepAngle
float
زاوية في درجات قياس زاوية الساعة من معيار startAngle’ لإنهاء نقطة القوس.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawBezier(السفينة، السفينة، السفينة، السفينة، السفينة، السفينة، السفينة، السفينة)
يضع خطًا Bézier يحدده أربعة أزواج من الإحداثيات التي تمثل النقاط.
public void DrawBezier(Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المنحنى.
x1
float
منسقة x من نقطة البداية في المنحنى.
y1
float
ي-منسق نقطة البداية من المنحنى.
x2
float
منسقة x من نقطة التحكم الأولى في المنحنى.
y2
float
ي-منسق أول نقطة التحكم في المنحنيات.
x3
float
منسقة x من نقطة التحكم الثانية في المنحنيات.
y3
float
منسقة y من نقطة التحكم الثانية في المنحنيات.
x4
float
منسقة x من نقطة النهاية في المنحنى.
y4
float
ي-تنسيق نقطة النهاية في المنحنى.
Exceptions
pen’ is null.
DrawBezier(نقطة، نقطة، نقطة، نقطة، نقطة)
يضع خطًا Bézier محددًا بأربعة هياكل Aspose.Imaging.PointF.
public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المنحنى.
pt1
PointF
هيكل Aspose.Imaging.PointF الذي يمثل نقطة انطلاق من المنحنى.
pt2
PointF
هيكل Aspose.Imaging.PointF الذي يمثل أول نقطة التحكم في المنحنى.
pt3
PointF
هيكل Aspose.Imaging.PointF الذي يمثل نقطة التحكم الثانية للمدينة.
pt4
PointF
هيكل Aspose.Imaging.PointF الذي يمثل نقطة النهاية في المنحنى.
Exceptions
pen’ is null.
DrawBezier(نقطة، نقطة، نقطة، نقطة)
يضع خطًا Bézier محددًا بأربعة هياكل Aspose.Imaging.Point.
public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
Parameters
pen
Pen
Aspose.Imaging.Pen هيكل يحدد اللون، وعرض، وأسلوب المنحنى.
pt1
Point
هيكل Aspose.Imaging.Point الذي يمثل نقطة البداية في المنحنى.
pt2
Point
هيكل Aspose.Imaging.Point الذي يمثل أول نقطة التحكم في المنحنى.
pt3
Point
هيكل Aspose.Imaging.Point الذي يمثل نقطة التحكم الثانية للمدينة.
pt4
Point
Aspose.Imaging.Point هيكل يمثل نقطة النهاية في المنحنى.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawBeziers(نقطة، نقطة[])
سحب سلسلة من أسطوانات Bézier من مجموعة من الهياكل Aspose.Imaging.Point.
public void DrawBeziers(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المنحنى.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تمثل النقاط التي تحدد المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawBeziers(البنطال، نقطة[])
سحب سلسلة من أسطوانات Bézier من مجموعة من الهياكل Aspose.Imaging.PointF.
public void DrawBeziers(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تمثل النقاط التي تحدد المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(البنطال، نقطة[])
يقطع شريط الكاردينال مغلق محدد بمجموعة من الهياكل Aspose.Imaging.PointF. هذه الطريقة تستخدم الجهد الافتراضي من 0.5 و Aspose.Imaging.FillMode.Alternate وضع ملء.
public void DrawClosedCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(البنطال، نقطة[ ]الملاحة)
يقطع شريط الكاردينال مغلق محدد بمجموعة من الهياكل Aspose.Imaging.PointF باستخدام ضغط محدد.هذه الطريقة تستخدم وضع ملء Aspose.Imaging.FillMode.Alternate الافتراضي.
public void DrawClosedCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(نقطة، نقطة[])
يقطع شريط الكاردينال مغلق محدد بمجموعة من الهياكل Aspose.Imaging.Point. هذه الطريقة تستخدم الجهد الافتراضي من 0.5 و Aspose.Imaging.FillMode.Alternate وضع ملء.
public void DrawClosedCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(نقطة، نقطة[ ]الملاحة)
يقطع خط القردة المغلقة المحددة بمجموعة من الهياكل Aspose.Imaging.Point باستخدام التوتر المحدد.هذه الطريقة تستخدم وضع ملء Aspose.Imaging.FillMode.Alternate الافتراضي.
public void DrawClosedCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(البنطال، نقطة[])
سحب خط الكاردينال من خلال مجموعة محددة من الهياكل Aspose.Imaging.PointF. هذه الطريقة تستخدم الجهد الافتراضي من 0.5.
public void DrawCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(البنطال، نقطة[ ]الملاحة)
سحب خط الكاردينال من خلال مجموعة محددة من الهياكل Aspose.Imaging.PointF باستخدام ضغط محدد.
public void DrawCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تمثل النقاط التي تحدد المنحنى.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(البنطال، نقطة[ ]إنت، إنت)
رسم خط الكاردينال من خلال سلسلة محددة من الهياكل Aspose.Imaging.PointF. يبدأ الرسم بدءا من بداية السلسلة.هذه الطريقة تستخدم الجهد الافتراضي 0.5.
public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
offset
int
إزالة من العنصر الأول في ترتيب معيار point’ إلى نقطة البداية في المنحنى.
numberOfSegments
int
عدد الأجزاء بعد نقطة البداية التي سيتم تضمينها في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(البنطال، نقطة[ ], int , int , float)
سحب خط الكاردينال من خلال سلسلة محددة من الهياكل Aspose.Imaging.PointF باستخدام ضغط محدد.
public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
offset
int
إزالة من العنصر الأول في ترتيب معيار point’ إلى نقطة البداية في المنحنى.
numberOfSegments
int
عدد الأجزاء بعد نقطة البداية التي سيتم تضمينها في المنحنى.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(نقطة، نقطة[])
سحب خط الكاردينال من خلال مجموعة محددة من الهياكل Aspose.Imaging.Point.
public void DrawCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(نقطة، نقطة[ ]الملاحة)
سحب خط الكاردينال من خلال سلسلة محددة من الهياكل Aspose.Imaging.Point باستخدام ضغط محدد.
public void DrawCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(نقطة، نقطة[ ], int , int , float)
سحب خط الكاردينال من خلال سلسلة محددة من الهياكل Aspose.Imaging.Point باستخدام ضغط محدد.
public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وارتفاع المنحنى.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
offset
int
إزالة من العنصر الأول في ترتيب معيار point’ إلى نقطة البداية في المنحنى.
numberOfSegments
int
عدد الأجزاء بعد نقطة البداية التي سيتم تضمينها في المنحنى.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
pen’ is null.-or-
points’ is null.
DrawEllipse(القضيب ، RectangleF)
يقطع إليبس يحدده الحدود Aspose.Imaging.RectangleF.
public void DrawEllipse(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الحصى.
rect
RectangleF
Aspose.Imaging.RectangleF الهيكل الذي يحدد حدود الانحناء.
Exceptions
pen’ is null.
DrawEllipse(البلاط، البلاط، البلاط، البلاط)
يقطع الانحناء الذي يحدده المستطيل الحدودي الذي يحدده زوج من الإحداثيات، وارتفاع، وعرض.
public void DrawEllipse(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الحصى.
x
float
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
y
float
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
width
float
عرض المستطيل الحدودي الذي يحدد الانحناء.
height
float
ارتفاع المستطيل الحدودي الذي يحدد الانحناء.
Exceptions
pen’ is null.
DrawEllipse(القضيب، العمود الفقري)
سحب إليبس المحدد من قبل الهيكل الحدودي Aspose.Imaging.Rectangle.
public void DrawEllipse(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الحصى.
rect
Rectangle
Aspose.Imaging.Rectangle هيكل يحدد الحدود من الإليبس.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawEllipse(إنت، إنت، إنت، إنت، إنت)
يقطع الانحناء الذي يحدده المستطيل الحدودي الذي يحدده زوج من الإحداثيات، وارتفاع، وعرض.
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الحصى.
x
int
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
y
int
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
width
int
عرض المستطيل الحدودي الذي يحدد الانحناء.
height
int
ارتفاع المستطيل الحدودي الذي يحدد الانحناء.
Exceptions
pen’ is null.
DrawImage(صورة، نقطة)
سحب Aspose.Imaging.Graphics.Image المحدد، باستخدام حجمها المادي الأصلي، في الموقع المحدد.
public void DrawImage(Image sourceImage, PointF point)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
point
PointF
هيكل Aspose.Imaging.PointF الذي يمثل الزاوية العليا اليسرى للصورة المسجلة.
Exceptions
sourceImage’ is null.
DrawImage(الصورة، السفينة، السفينة)
سحب Aspose.Imaging.Graphics.Image المحدد، باستخدام حجمها المادي الأصلي، في الموقع المحدد.
public void DrawImage(Image sourceImage, float x, float y)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
x
float
منسقة x من الزاوية العليا اليسرى للصورة المسجلة.
y
float
منسقة y من الزاوية العليا اليسرى للصورة المقطوعة.
Exceptions
sourceImage’ is null.
DrawImage(الصورة، RectangleF)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, RectangleF rect)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rect
RectangleF
هيكل Aspose.Imaging.RectangleF الذي يحدد موقع وحجم الصورة المسجلة.
Exceptions
sourceImage’ is null.
DrawImage(الصورة, Rectangle, Graphics)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectDestination
Rectangle
المستوى المستوى المستهدف.
graphicsUnit
GraphicsUnit
وحدة الرسومات .
Exceptions
sourceImage’ is null.
DrawImage(صورة, RectangleF, GraphicsUnit)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectDestination
RectangleF
المستوى المستوى المستهدف.
graphicsUnit
GraphicsUnit
وحدة الرسومات .
Exceptions
sourceImage’ is null.
DrawImage(الصورة, Rectangle, GraphicsUnit, ImageAttributes)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectDestination
Rectangle
المستوى المستوى المستهدف.
graphicsUnit
GraphicsUnit
وحدة الرسومات .
imageAttributes
ImageAttributes
الصورة لها خصائص.
Exceptions
sourceImage’ is null.
DrawImage(صورة, RectangleF, GraphicsUnit, ImageAttributes)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectDestination
RectangleF
الجهة المستهدفة التي سيتم سحبها.
graphicsUnit
GraphicsUnit
وحدة الرسومات .
imageAttributes
ImageAttributes
الصورة لها خصائص.
Exceptions
sourceImage’ is null.
DrawImage(الصورة، Rectangle، Rectangle، رسومات)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectSource
Rectangle
المصدر المستقيم .
rectDestination
Rectangle
الهدف المستقيم .
graphicsUnit
GraphicsUnit
وحدة الرسومات .
Exceptions
sourceImage’ is null.
DrawImage(صورة, RectangleF, RectangleF, GraphicsUnit)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectSource
RectangleF
المصدر المستقيم .
rectDestination
RectangleF
الهدف المستقيم .
graphicsUnit
GraphicsUnit
وحدة الرسومات .
Exceptions
sourceImage’ is null.
DrawImage(صورة, Rectangle, Rectangle, GraphicsUnit, ImageAttributes)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectSource
Rectangle
المصدر المستقيم .
rectDestination
Rectangle
الهدف المستقيم .
graphicsUnit
GraphicsUnit
وحدة الرسومات .
imageAttributes
ImageAttributes
الصورة لها خصائص.
Exceptions
sourceImage’ is null.
DrawImage(صورة, RectangleF, RectangleF, GraphicsUnit, ImageAttributes)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rectSource
RectangleF
المصدر المستقيم .
rectDestination
RectangleF
المستوى المستوى المستهدف.
graphicsUnit
GraphicsUnit
وحدة الرسومات المستخدمة.
imageAttributes
ImageAttributes
الصورة تتميز باستخدامها.
Exceptions
sourceImage’ is null.
DrawImage(صورة، نقطة[])
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, Point[] destPoints)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
Point
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
DrawImage(صورة، نقطة[ ]اليمين اليمين)
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
Point
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
srcRect
Rectangle
المصدر المستقيم .
DrawImage(صورة، نقطة[ ], Rectangle , GraphicsUnit)
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
Point
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
srcRect
Rectangle
المصدر المستقيم .
srcUnit
GraphicsUnit
وحدات القياس .
DrawImage(صورة، نقطة[ ]، Rectangle ، GraphicsUnit ، ImageAttributes)
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
Point
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
srcRect
Rectangle
المصدر المستقيم .
srcUnit
GraphicsUnit
وحدات القياس .
imageAttributes
ImageAttributes
الصورة لها خصائص.
DrawImage(صورة، نقطة[])
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
PointF
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
Exceptions
صورة
DrawImage(صورة، نقطة[ ], RectangleF)
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
PointF
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
srcRect
RectangleF
المصدر المستقيم .
DrawImage(صورة، نقطة[ ]، RectangleF ، GraphicsUnit)
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
PointF
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
srcRect
RectangleF
المصدر المستقيم .
srcUnit
GraphicsUnit
وحدات القياس .
DrawImage(صورة، نقطة[ ]، RectangleF ، GraphicsUnit ، ImageAttributes)
سحب الجزء المحدد من الصورة المحددة " في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
الصورة التي يجب رسمها
destPoints
PointF
[ ]
مجموعة من ثلاثة هيكلات PointF التي تحدد الموازين.
srcRect
RectangleF
المصدر المستقيم .
srcUnit
GraphicsUnit
وحدات القياس .
imageAttributes
ImageAttributes
الصورة لها خصائص.
DrawImage(الصورة، السفينة، السفينة، السفينة)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, float x, float y, float width, float height)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
x
float
منسقة x من الزاوية العليا اليسرى للصورة المسجلة.
y
float
منسقة y من الزاوية العليا اليسرى للصورة المقطوعة.
width
float
واسعة من الصورة المطروحة.
height
float
ارتفاع الصورة المقطوعة.
Exceptions
sourceImage’ is null.
DrawImage(صورة، نقطة)
سحب Aspose.Imaging.Graphics.Image المحدد، باستخدام حجمها المادي الأصلي، في الموقع المحدد.
public void DrawImage(Image sourceImage, Point point)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
point
Point
هيكل Aspose.Imaging.Point الذي يمثل موقع الزاوية العليا اليسرى للصورة المسجلة.
Exceptions
sourceImage’ is null.
DrawImage(الصورة، int، int)
سحب الصورة المحددة، باستخدام حجمها المادي الأصلي، في الموقع المحدد من قبل زوج من الإحداثيات.
public void DrawImage(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
x
int
منسقة x من الزاوية العليا اليسرى للصورة المسجلة.
y
int
منسقة y من الزاوية العليا اليسرى للصورة المقطوعة.
Exceptions
sourceImage’ is null.
DrawImage(الصورة , Rectangle)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rect
Rectangle
هيكل Aspose.Imaging.Rectangle الذي يحدد موقع وحجم الصورة المسجلة.
Exceptions
sourceImage’ is null.
DrawImage(الصورة، int، int، int، int)
سحب Aspose.Imaging.Graphics.Image المحدد في الموقع المحدد ومع الحجم المحدد.
public void DrawImage(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
x
int
منسقة x من الزاوية العليا اليسرى للصورة المسجلة.
y
int
منسقة y من الزاوية العليا اليسرى للصورة المقطوعة.
width
int
واسعة من الصورة المطروحة.
height
int
ارتفاع الصورة المقطوعة.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(صورة، نقطة)
سحب صورة محددة باستخدام حجمها المادي الأصلي في موقع محدد.
public void DrawImageUnscaled(Image sourceImage, Point point)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
point
Point
هيكل Aspose.Imaging.Point الذي يحدد الزاوية العليا اليسرى للصورة المسجلة.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(الصورة، int، int)
سحب الصورة المحددة باستخدام حجمها المادي الأصلي في الموقع المحدد من قبل زوج من الإحداثيات.
public void DrawImageUnscaled(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
x
int
منسقة x من الزاوية العليا اليسرى للصورة المسجلة.
y
int
منسقة y من الزاوية العليا اليسرى للصورة المقطوعة.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(الصورة , Rectangle)
سحب صورة محددة باستخدام حجمها المادي الأصلي في موقع محدد.
public void DrawImageUnscaled(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rect
Rectangle
Aspose.Imaging.Rectangle الذي يحدد الزاوية العليا اليسرى للصورة المسجلة.الخصائص X و Y من الزاوية العليا يحدد الزاوية العليا اليسرى.يتم تجاهل خصائص العرض والارتفاع.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(الصورة، int، int، int، int)
سحب صورة محددة باستخدام حجمها المادي الأصلي في موقع محدد.
public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
x
int
منسقة x من الزاوية العليا اليسرى للصورة المسجلة.
y
int
منسقة y من الزاوية العليا اليسرى للصورة المقطوعة.
width
int
لا يتم استخدام المعايير.
height
int
لا يتم استخدام المعايير.
Exceptions
sourceImage’ is null.
DrawImageUnscaledAndClipped(الصورة , Rectangle)
سحب الصورة المحددة دون تقسيم وتقطيعها، إذا لزم الأمر، لتناسب في المستطيل المحدد.
public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
الصورة التي سيتم رسمها معها.
rect
Rectangle
Aspose.Imaging.Rectangle التي يمكن رسم الصورة.
Exceptions
sourceImage’ is null.
DrawLine(نقطة، نقطة، نقطة)
سحب خط يربط اثنين من الهياكل Aspose.Imaging.Point.
public void DrawLine(Pen pen, Point point1, Point point2)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الخط.
point1
Point
هيكل Aspose.Imaging.Point الذي يمثل النقطة الأولى للاتصال.
point2
Point
Aspose.Imaging.Point هيكل يمثل النقطة الثانية للاتصال.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawLine(نقطة، نقطة، نقطة)
سحب خط يربط اثنين من الهياكل Aspose.Imaging.PointF.
public void DrawLine(Pen pen, PointF point1, PointF point2)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الخط.
point1
PointF
هيكل Aspose.Imaging.PointF الذي يمثل النقطة الأولى للاتصال.
point2
PointF
هيكل Aspose.Imaging.PointF الذي يمثل النقطة الثانية للاتصال.
Exceptions
pen’ is null.
DrawLine(إنت، إنت، إنت، إنت، إنت)
يقطع خطًا يربط النقاط المحددة من قبل أزواج الإحداثيات.
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الخط.
x1
int
منسقة X من النقطة الأولى.
y1
int
منسقة النقطة الأولى.
x2
int
منسقة X من النقطة الثانية.
y2
int
منسقة النقطة الثانية.
Exceptions
pen’ is null.
DrawLine(البلاط، البلاط، البلاط، البلاط)
يقطع خطًا يربط النقاط المحددة من قبل أزواج الإحداثيات.
public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الخط.
x1
float
منسقة X من النقطة الأولى.
y1
float
منسقة النقطة الأولى.
x2
float
منسقة X من النقطة الثانية.
y2
float
منسقة النقطة الثانية.
Exceptions
pen’ is null.
DrawLines(نقطة، نقطة[])
تسجيل سلسلة من أقسام الخط الذي يربط سلسلة من الهياكل Aspose.Imaging.Point.
public void DrawLines(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب قطاعات الخط.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تمثل النقاط للاتصال.
Exceptions
pen’ is null.-or-
points’ is null.
يحتوي سلسلة points على أقل من 2 نقطة.
DrawLines(البنطال، نقطة[])
تسجيل سلسلة من أقسام الخط الذي يربط سلسلة من الهياكل Aspose.Imaging.PointF.
public void DrawLines(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب قطاعات الخط.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تمثل النقاط للاتصال.
Exceptions
pen’ is null.-or-
points’ is null.
يحتوي سلسلة points على أقل من 2 نقطة.
DrawPath(الرسوم البيانية, GraphicsPath)
أضف تعليق حول Aspose.Imaging.GraphicsPath
public void DrawPath(Pen pen, GraphicsPath path)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المسار.
path
GraphicsPath
أضف تعليق حول كيفية رسم الرسومات.
Examples
هذه الأمثلة تستخدم فئة GraphicsPath و Graphics لإنشاء وتلاعب الأرقام على سطح الصورة. نموذج يخلق صورة جديدة (من نوع Tiff) ، ويطهر السطح ويسحب المسارات بمساعدة فئة GraphicsPath.
//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
//Create an instance of TiffOptions and set its various properties
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
//Set the source for the instance of ImageOptions
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();
//Create an instance of Figure class
Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.-or-
path’ is null.
DrawPie(القلم، القلم، القلم، القلم)
يضع شكلًا من الشرائح محددًا بواسطة إليبس محددًا بواسطة بنية Aspose.Imaging.RectangleF و خطين رادياليين.
public void DrawPie(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الشكل.
rect
RectangleF
هيكل Aspose.Imaging.RectangleF الذي يمثل المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من شكل القوس.
startAngle
float
الزاوية التي يتم قياسها في درجات زمنية من محور x إلى الجانب الأول من شكل القوس.
sweepAngle
float
الزاوية التي يتم قياسها في درجات زمنية من معيار startAngle’ إلى الجانب الآخر من شكل القوس.
Exceptions
pen’ is null.
DrawPie(البلاط، البلاط، البلاط، البلاط، البلاط)
يقطع شكل قوس محدد بواسطة إليبس المحدد بواسطة زوج من الإحداثيات، وعرض، وارتفاع، وخطين رادياليين.
public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الشكل.
x
float
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الإليبس الذي يأتي من شكل الرماد.
y
float
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الإليبس الذي يأتي من شكل الورك.
width
float
عرض المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من شكل القوس.
height
float
الارتفاع من المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من شكل الجمجمة.
startAngle
float
الزاوية التي يتم قياسها في درجات زمنية من محور x إلى الجانب الأول من شكل القوس.
sweepAngle
float
الزاوية التي يتم قياسها في درجات زمنية من معيار startAngle’ إلى الجانب الآخر من شكل القوس.
Exceptions
pen’ is null.
DrawPie(قوس قزح، قوس قزح، قوس قزح)
يضع شكلًا من الشرائح المحدد بواسطة إليبس المحدد بواسطة بنية Aspose.Imaging.Rectangle و خطين رادياليين.
public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الشكل.
rect
Rectangle
Aspose.Imaging.Rectangle هيكل يمثل المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من شكل القوس.
startAngle
float
الزاوية التي يتم قياسها في درجات زمنية من محور x إلى الجانب الأول من شكل القوس.
sweepAngle
float
الزاوية التي يتم قياسها في درجات زمنية من معيار startAngle’ إلى الجانب الآخر من شكل القوس.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawPie(إنت، إنت، إنت، إنت، إنت، إنت)
يقطع شكل قوس محدد بواسطة إليبس المحدد بواسطة زوج من الإحداثيات، وعرض، وارتفاع، وخطين رادياليين.
public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الشكل.
x
int
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الإليبس الذي يأتي من شكل الرماد.
y
int
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الإليبس الذي يأتي من شكل الورك.
width
int
عرض المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من شكل القوس.
height
int
الارتفاع من المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من شكل الجمجمة.
startAngle
int
الزاوية التي يتم قياسها في درجات زمنية من محور x إلى الجانب الأول من شكل القوس.
sweepAngle
int
الزاوية التي يتم قياسها في درجات زمنية من معيار startAngle’ إلى الجانب الآخر من شكل القوس.
Exceptions
pen’ is null.
DrawPolygon(البنطال، نقطة[])
يقطع بوليغون محدد بمجموعة من الهياكل Aspose.Imaging.PointF.
public void DrawPolygon(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب البوليغون.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تمثل أعمدة البوليغون.
Exceptions
pen’ is null.-or-
points’ is null.
DrawPolygon(نقطة، نقطة[])
يقطع بوليغون محدد بمجموعة من الهياكل Aspose.Imaging.Point.
public void DrawPolygon(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب البوليغون.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تمثل الدوائر من البوليغون.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawRectangle(القضيب ، RectangleF)
يقطع مستطيلًا يحدده بنية Aspose.Imaging.RectangleF.
public void DrawRectangle(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المستطيل.
rect
RectangleF
هيكل Aspose.Imaging.RectangleF الذي يمثل المستطيل للطباعة.
Exceptions
pen’ is null.
DrawRectangle(القضيب، العمود الفقري)
يقطع مستطيلًا يحدده بنية Aspose.Imaging.Rectangle.
public void DrawRectangle(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المستطيل.
rect
Rectangle
هيكل Aspose.Imaging.Rectangle الذي يمثل المستطيل للطباعة.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawRectangle(البلاط، البلاط، البلاط، البلاط)
سحب مستطيل محدد من قبل زوج من الإحداثيات، وعرض، وارتفاع.
public void DrawRectangle(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المستطيل.
x
float
منسقة x من الزاوية العليا اليسرى من المستطيل للطباعة.
y
float
ي-منسق الزاوية العليا اليسرى من المستطيل لالتقاط.
width
float
عرض المستطيل للطباعة.
height
float
الارتفاع من المستطيل للطباعة.
Exceptions
pen’ is null.
DrawRectangle(إنت، إنت، إنت، إنت، إنت)
سحب مستطيل محدد من قبل زوج من الإحداثيات، وعرض، وارتفاع.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب المستطيل.
x
int
منسقة x من الزاوية العليا اليسرى من المستطيل للطباعة.
y
int
ي-منسق الزاوية العليا اليسرى من المستطيل لالتقاط.
width
int
واسعة من المستطيل للطباعة.
height
int
الارتفاع من المستطيل لالتقاط.
Exceptions
pen’ is null.
DrawRectangles(القضيب ، RectangleF[])
يقطع سلسلة من المستطيلات المحددة من قبل Aspose.Imaging.RectangleF الهياكل.
public void DrawRectangles(Pen pen, RectangleF[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الخرائط من المستطيلات.
rects
RectangleF
[ ]
مجموعة من الهياكل Aspose.Imaging.RectangleF التي تمثل المستطيلات للطباعة.
Exceptions
pen’ is null.-or-
rects’ is null.
DrawRectangles(القضيب، العمود الفقري[])
يقطع سلسلة من المستطيلات المحددة من قبل Aspose.Imaging.Rectangle الهياكل.
public void DrawRectangles(Pen pen, Rectangle[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen الذي يحدد اللون، وعرض، وأسلوب الخرائط من المستطيلات.
rects
Rectangle
[ ]
مجموعة من Aspose.Imaging.Rectangle الهياكل التي تمثل المستطيلات للطباعة.
Examples
هذا المثال يظهر كيفية إنشاء واستخدام كائنات القلم.المثال يخلق صورة جديدة ويرسم الزوايا الخلفية على سطح الصورة.
//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();
}
Exceptions
pen’ is null.-or-
rects’ is null.
DrawString(الشريط، الخط، الشريط، الشريط، الشريط)
سحب شريط النص المحدد في الموقع المحدد مع الأشياء المحددة Aspose.Imaging.Brush و Aspose.Imaging.Font.
public void DrawString(string s, Font font, Brush brush, float x, float y)
Parameters
s
string
قوس قزح للطباعة
font
Font
Aspose.Imaging.Font الذي يحدد تنسيق النص في السلسلة.
brush
Brush
Aspose.Imaging.Brush الذي يحدد اللون والنسيج من النص المقطوع.
x
float
منسقة x من الزاوية العليا اليسرى للنص المقطوع.
y
float
منسقة y من الزاوية العليا اليسرى للنص المقطوع.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(الخطوط، الخطوط، Brush، PointF)
سحب شريط النص المحدد في الموقع المحدد مع الأشياء المحددة Aspose.Imaging.Brush و Aspose.Imaging.Font.
public void DrawString(string s, Font font, Brush brush, PointF point)
Parameters
s
string
قوس قزح للطباعة
font
Font
Aspose.Imaging.Font الذي يحدد تنسيق النص في السلسلة.
brush
Brush
Aspose.Imaging.Brush الذي يحدد اللون والنسيج من النص المقطوع.
point
PointF
هيكل Aspose.Imaging.PointF الذي يحدد الزاوية العليا اليسرى للنص المقطوع.
Examples
هذا المثال يستخدم فئة الرسومات لإنشاء أشكال بدائية على سطح الصورة.لإظهار العملية، يخلق المثال صورة جديدة في شكل PNG ويطرح أشكال بدائية على سطح الصورة باستخدام أساليب الرسم المعروضة من فئة الرسومات
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
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));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
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) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
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);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
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) });
//Draw a Rectangle
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)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(الشريط, Font, Brush, float, float, StringFormat)
سحب شريط النص المحدد في الموقع المحدد مع الكائنات المحددة Aspose.Imaging.Brush و Aspose.Imaging.Font باستخدام خصائص تنسيق Aspose.Imaging.StringFormat المحددة.
public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format)
Parameters
s
string
قوس قزح للطباعة
font
Font
Aspose.Imaging.Font الذي يحدد تنسيق النص في السلسلة.
brush
Brush
Aspose.Imaging.Brush الذي يحدد اللون والنسيج من النص المقطوع.
x
float
منسقة x من الزاوية العليا اليسرى للنص المقطوع.
y
float
منسقة y من الزاوية العليا اليسرى للنص المقطوع.
format
StringFormat
Aspose.Imaging.StringFormat الذي يحدد خصائص التنسيق، مثل مساحة الخط والتوحيد، والتي يتم تطبيقها على النص المقطوع.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(قوس قزح، قوس قزح، PointF، StringFormat)
سحب شريط النص المحدد في الموقع المحدد مع الكائنات المحددة Aspose.Imaging.Brush و Aspose.Imaging.Font باستخدام خصائص تنسيق Aspose.Imaging.StringFormat المحددة.
public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)
Parameters
s
string
قوس قزح للطباعة
font
Font
Aspose.Imaging.Font الذي يحدد تنسيق النص في السلسلة.
brush
Brush
Aspose.Imaging.Brush الذي يحدد اللون والنسيج من النص المقطوع.
point
PointF
هيكل Aspose.Imaging.PointF الذي يحدد الزاوية العليا اليسرى للنص المقطوع.
format
StringFormat
Aspose.Imaging.StringFormat الذي يحدد خصائص التنسيق، مثل مساحة الخط والتوحيد، والتي يتم تطبيقها على النص المقطوع.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(الحبل، الحبل، الحبل، RectangleF)
سحب شريط النص المحدد في المستطيل المحدد مع الكائنات المحددة Aspose.Imaging.Brush و Aspose.Imaging.Font.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)
Parameters
s
string
قوس قزح للطباعة
font
Font
Aspose.Imaging.Font الذي يحدد تنسيق النص في السلسلة.
brush
Brush
Aspose.Imaging.Brush الذي يحدد اللون والنسيج من النص المقطوع.
layoutRectangle
RectangleF
هيكل Aspose.Imaging.RectangleF الذي يحدد موقع النص المقطوع.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(قوس قزح، قوس قزح، قوس قزح، قوس قزح)
سحب شريط النص المحدد في المستطيل المحدد مع Aspose.Imaging.Brush و Aspose.Imaging.Font الكائنات المحددة باستخدام خصائص تنسيق Aspose.Imaging.StringFormat المحددة.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
Parameters
s
string
قوس قزح للطباعة
font
Font
Aspose.Imaging.Font الذي يحدد تنسيق النص في السلسلة.
brush
Brush
Aspose.Imaging.Brush الذي يحدد اللون والنسيج من النص المقطوع.
layoutRectangle
RectangleF
هيكل Aspose.Imaging.RectangleF الذي يحدد موقع النص المقطوع.
format
StringFormat
Aspose.Imaging.StringFormat الذي يحدد خصائص التنسيق، مثل مساحة الخط والتوحيد، والتي يتم تطبيقها على النص المقطوع.
Exceptions
brush’ is null.-or-
s’ is null.-or-
brush’ is null.
EndUpdate()
يتم الانتهاء من تسجيل العمليات الرسومية التي بدأت بعد استدعاء BeginUpdate. سيتم تطبيق العمليات الرسومية السابقة على الفور عند استدعاء هذه الطريقة.
public void EndUpdate()
FillClosedCurve(الفوركس، نقطة[])
يملأ الداخلي من قوس قزح الكاردينال مغلقة محددة من قبل سلسلة من الهياكل Aspose.Imaging.PointF. هذه الطريقة تستخدم الجهد الافتراضي من 0.5 و Aspose.Imaging.FillMode.Alternate وضع ملء.
public void FillClosedCurve(Brush brush, PointF[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(الفوركس، نقطة[ ]فيلماود)
يملأ الداخلي من منحنى الكاردينال مغلقة محددة بمجموعة من الهياكل Aspose.Imaging.PointF باستخدام وضع التعبئة المحدد.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
fillMode
FillMode
عضو في قائمة Aspose.Imaging.FillMode التي تحدد كيفية ملء المنحنى.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(الفوركس، نقطة[ ]، FillMode ، Float)
يملأ الداخلي من قوس قزح الكاردينال مغلق محدد من قبل سلسلة من الهياكل Aspose.Imaging.PointF باستخدام وضع التعبئة المحدد والتوتر.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تحدد الخط.
fillmode
FillMode
عضو في قائمة Aspose.Imaging.FillMode التي تحدد كيفية ملء المنحنى.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(نقطة، نقطة[])
يملأ الداخلي من قوس قزح الكاردينال مغلقة محددة من قبل سلسلة من الهياكل Aspose.Imaging.Point. هذه الطريقة تستخدم الجهد الافتراضي من 0.5 و Aspose.Imaging.FillMode.Alternate وضع ملء.
public void FillClosedCurve(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(نقطة، نقطة[ ]فيلماود)
يملأ الداخلي من قوس قزح الكاردينال مغلقة محددة من قبل سلسلة من الهياكل Aspose.Imaging.Point باستخدام وضع ملء محدد.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
fillmode
FillMode
عضو في قائمة Aspose.Imaging.FillMode التي تحدد كيفية ملء المنحنى.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(نقطة، نقطة[ ]، FillMode ، Float)
يملأ الداخلي من قوس قزح الكاردينال مغلقة محددة من قبل سلسلة من الهياكل Aspose.Imaging.Point باستخدام وضع التعبئة المحدد والتوتر.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
Point
[ ]
مجموعة من الهياكل Aspose.Imaging.Point التي تحدد الخط.
fillmode
FillMode
عضو في قائمة Aspose.Imaging.FillMode التي تحدد كيفية ملء المنحنى.
tension
float
قيمة أكبر أو تساوي 0.0F التي تحدد الجهد في المنحنى.
Exceptions
brush’ is null.-or-
points’ is null.
FillEllipse(الفراولة، RectangleF)
يملأ الداخلي من الانحناء المحدد من قبل مستطيل الحدود المحدد من قبل بنية Aspose.Imaging.RectangleF.
public void FillEllipse(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rect
RectangleF
Aspose.Imaging.RectangleF هيكل يمثل المستطيل الحدودي الذي يحدد الانحناء.
Exceptions
brush’ is null.
FillEllipse(السفينة، السفينة، السفينة، السفينة)
يملأ الداخلي من الانحناء المحدد من قبل مستطيل الحدود المحدد من قبل زوج من الإحداثيات، وعرض، وارتفاع.
public void FillEllipse(Brush brush, float x, float y, float width, float height)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
x
float
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
y
float
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
width
float
عرض المستطيل الحدودي الذي يحدد الانحناء.
height
float
ارتفاع المستطيل الحدودي الذي يحدد الانحناء.
Exceptions
brush’ is null.
FillEllipse(الفراولة ، Rectangle)
يملأ الداخلي من الانحناء المحدد من قبل مستطيل الحدود المحدد من قبل بنية Aspose.Imaging.Rectangle.
public void FillEllipse(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rect
Rectangle
Aspose.Imaging.Rectangle هيكل يمثل المستطيل الحدودي الذي يحدد الانحناء.
Exceptions
brush’ is null.
FillEllipse(إنت، إنت، إنت، إنت)
يملأ الداخلي من الانحناء المحدد من قبل مستطيل الحدود المحدد من قبل زوج من الإحداثيات، وعرض، وارتفاع.
public void FillEllipse(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
x
int
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
y
int
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء.
width
int
عرض المستطيل الحدودي الذي يحدد الانحناء.
height
int
ارتفاع المستطيل الحدودي الذي يحدد الانحناء.
Exceptions
brush’ is null.
FillPath(الرسوم البيانية, GraphicsPath)
يملأ داخل Aspose.Imaging.GraphicsPath.
public void FillPath(Brush brush, GraphicsPath path)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
path
GraphicsPath
Aspose.Imaging.Graphicsالطريق الذي يمثل الطريق إلى ملء.
Exceptions
brush’ is null.-or-
path’ is null.
FillPie(الفراولة، الفراولة، الفراولة، الفراولة)
يملأ الداخلي من القسم المحدد من قبل إليبس المحدد من قبل هيكل Aspose.Imaging.RectangleF و اثنين من الخطوط الجذعية.
public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rect
Rectangle
Aspose.Imaging.Rectangle هيكل يمثل المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم.
startAngle
float
زاوية في درجات قياس على نحو الساعة من محور x إلى الجانب الأول من القسم.
sweepAngle
float
الزاوية في الدرجات التي يتم قياسها على طول الساعة من معيار startAngle’ إلى الجانب الآخر من القسم.
Examples
يظهر المثال التالي كيفية تكوين صورة GIF الرسوم المتحركة من كتل GIF الفردية.
string dir = "c:\\temp\\";
// Create a GIF image 100 x 100 px.
// The first block is fully black by default.
using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
{
// The first circle is red
Aspose.Imaging.Brushes.SolidBrush brush1 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
// The second circle is black
Aspose.Imaging.Brushes.SolidBrush brush2 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);
// Gradually inscrease the angle of the red arc shape.
for (int angle = 10; angle <= 360; angle += 10)
{
Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
gr.FillPie(brush1, block.Bounds, 0, angle);
gifImage.AddBlock(block);
}
// Gradually inscrease the angle of the black arc and wipe out the red arc.
for (int angle = 10; angle <= 360; angle += 10)
{
Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
gr.FillPie(brush2, block.Bounds, 0, angle);
gr.FillPie(brush1, block.Bounds, angle, 360 - angle);
gifImage.AddBlock(block);
}
gifImage.Save(dir + "animated_radar.gif");
}
Exceptions
brush’ is null.
FillPie(الرش، RectangleF، السفينة، السفينة)
يملأ الداخلي من القسم المحدد من قبل إليبس المحدد من قبل هيكل Aspose.Imaging.RectangleF و اثنين من الخطوط الجذعية.
public void FillPie(Brush brush, RectangleF rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rect
RectangleF
هيكل Aspose.Imaging.RectangleF الذي يمثل المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم.
startAngle
float
زاوية في درجات قياس على نحو الساعة من محور x إلى الجانب الأول من القسم.
sweepAngle
float
الزاوية في الدرجات التي يتم قياسها على طول الساعة من معيار startAngle’ إلى الجانب الآخر من القسم.
Exceptions
brush’ is null.
FillPie(السفينة، السفينة، السفينة، السفينة، السفينة، السفينة)
يملأ الداخلي من القسم المحدد من قبل إليبس المحدد من قبل زوج من الإحداثيات، وعرض، وارتفاع، وثلاثة خطوط راديال.
public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
x
float
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم القصير.
y
float
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم القصير.
width
float
عرض المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم.
height
float
ارتفاع المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم.
startAngle
float
زاوية في درجات قياس على نحو الساعة من محور x إلى الجانب الأول من القسم.
sweepAngle
float
الزاوية في الدرجات التي يتم قياسها على طول الساعة من معيار startAngle’ إلى الجانب الآخر من القسم.
Exceptions
brush’ is null.
FillPie(إنت، إنت، إنت، إنت، إنت)
يملأ الداخلي من القسم المحدد من قبل إليبس المحدد من قبل زوج من الإحداثيات، وعرض، وارتفاع، وثلاثة خطوط راديال.
public void FillPie(Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
x
int
منسق x من الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم القصير.
y
int
ي-منسق الزاوية العليا اليسرى من المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم القصير.
width
int
عرض المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم.
height
int
ارتفاع المستطيل الحدودي الذي يحدد الانحناء الذي يأتي من القسم.
startAngle
int
زاوية في درجات قياس على نحو الساعة من محور x إلى الجانب الأول من القسم.
sweepAngle
int
الزاوية في الدرجات التي يتم قياسها على طول الساعة من معيار startAngle’ إلى الجانب الآخر من القسم.
Exceptions
brush’ is null.
FillPolygon(الفوركس، نقطة[])
يملأ داخل البوليغون المحدد من قبل مجموعة من النقاط المحددة من قبل Aspose.Imaging.PointF الهياكل و Aspose.Imaging.FillMode.Alternate.
public void FillPolygon(Brush brush, PointF[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تمثل الدوائر من البوليغون لملء.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(الفوركس، نقطة[ ]فيلماود)
يملأ داخل البوليغون المحدد بمجموعة من النقاط المحددة من قبل الهياكل Aspose.Imaging.PointF باستخدام وضع ملء المحدد.
public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
PointF
[ ]
مجموعة من الهياكل Aspose.Imaging.PointF التي تمثل الدوائر من البوليغون لملء.
fillMode
FillMode
عضو في قائمة Aspose.Imaging.FillMode التي تحدد نمط ملء.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(نقطة، نقطة[])
يملأ داخل البوليغون المحدد من قبل مجموعة من النقاط المحددة من قبل Aspose.Imaging.Point الهياكل و Aspose.Imaging.FillMode.Alternate.
public void FillPolygon(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
Point
[ ]
مجموعة من Aspose.Imaging.Point الهياكل التي تمثل الدوائر من البوليغون لملء.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(نقطة، نقطة[ ]فيلماود)
يملأ داخل البوليغون المحدد من خلال مجموعة من النقاط المحددة من قبل Aspose.Imaging.Point الهياكل باستخدام وضع ملء المحدد.
public void FillPolygon(Brush brush, Point[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
points
Point
[ ]
مجموعة من Aspose.Imaging.Point الهياكل التي تمثل الدوائر من البوليغون لملء.
fillMode
FillMode
عضو في قائمة Aspose.Imaging.FillMode التي تحدد نمط ملء.
Exceptions
brush’ is null.-or-
points’ is null.
FillRectangle(الفراولة ، Rectangle)
يملأ الداخلي من المستطيل المحدد من قبل بنية Aspose.Imaging.Rectangle.
public void FillRectangle(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rect
Rectangle
Aspose.Imaging.Rectangle هيكل يمثل المستطيل لملء.
Exceptions
brush’ is null.
FillRectangle(الفراولة، RectangleF)
يملأ الداخلي من المستطيل المحدد من قبل بنية Aspose.Imaging.RectangleF.
public void FillRectangle(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rect
RectangleF
Aspose.Imaging.RectangleF هيكل يمثل المستطيل لملء.
Exceptions
brush’ is null.
FillRectangle(السفينة، السفينة، السفينة، السفينة)
يملأ الداخلي من المستطيل المحدد من قبل زوج من الإحداثيات، وعرض وارتفاع.
public void FillRectangle(Brush brush, float x, float y, float width, float height)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
x
float
منسقة x من الزاوية العليا اليسرى من المستطيل لملء.
y
float
منسقة y من الزاوية العليا اليسرى من المستطيل لملء.
width
float
واسعة من المستطيل لملء.
height
float
الارتفاع من المستطيل لملء.
Exceptions
brush’ is null.
FillRectangle(إنت، إنت، إنت، إنت)
يملأ الداخلي من المستطيل المحدد من قبل زوج من الإحداثيات، وعرض وارتفاع.
public void FillRectangle(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
x
int
منسقة x من الزاوية العليا اليسرى من المستطيل لملء.
y
int
منسقة y من الزاوية العليا اليسرى من المستطيل لملء.
width
int
واسعة من المستطيل لملء.
height
int
الارتفاع من المستطيل لملء.
Exceptions
brush’ is null.
FillRectangles(الفراولة ، Rectangle[])
يملأ الداخلية من سلسلة من المستطيلات المحددة من قبل Aspose.Imaging.Rectangle الهياكل.
public void FillRectangles(Brush brush, Rectangle[] rects)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rects
Rectangle
[ ]
مجموعة من Aspose.Imaging.Rectangle الهياكل التي تمثل المستطيلات لملء.
Exceptions
brush’ is null or
rects’ is null.
FillRectangles(الفراولة، RectangleF[])
يملأ الداخلية من سلسلة من المستطيلات المحددة من قبل Aspose.Imaging.RectangleF الهياكل.
public void FillRectangles(Brush brush, RectangleF[] rects)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
rects
RectangleF
[ ]
مجموعة من Aspose.Imaging.Rectangle الهياكل التي تمثل المستطيلات لملء.
Exceptions
brush’ is null or
rects’ is null.
FillRegion(برشلونة , المنطقة)
يملأ الداخلي من Aspose.Imaging.Region.
public void FillRegion(Brush brush, Region region)
Parameters
brush
Brush
Aspose.Imaging.Brush الذي يحدد خصائص ملء.
region
Region
Aspose.Imaging.المنطقة التي تمثل المنطقة التي يجب ملؤها.
Exceptions
brush’ is null.-or-
region’ is null.
~Graphics()
protected ~Graphics()
MeasureString(الخطوط، الخطوط، SizeF، StringFormat)
قياس سلسلة النص المحددة مع المعلمات المحددة
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameters
text
string
النص الذي يجب قياسه.
font
Font
الحروف التي يجب قياسها.
layoutArea
SizeF
منطقة التصميم .
stringFormat
StringFormat
شكل الشريط .
Returns
حجم في بكسل من شريط النص المقياس
MultiplyTransform(Matrix)
يتضاعف Aspose.Imaging.Matrix الذي يمثل التحول الجيومترية المحلية لهذا Aspose.Imaging.Graphics من خلال Aspose.Imaging.Matrix المحدد من خلال تخصيص Aspose.Imaging.Matrix المحدد.
public void MultiplyTransform(Matrix matrix)
Parameters
matrix
Matrix
Aspose.Imaging.Matrix التي لتضاعف التحول الجيومترية.
MultiplyTransform(ماتريكس MatrixOrder)
يتضاعف Aspose.Imaging.Matrix الذي يمثل التحول الجيومترية المحلية لهذا Aspose.Imaging.Graphics بواسطة Aspose.Imaging.Matrix المحدد في الترتيب المحدد.
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
Aspose.Imaging.Matrix التي لتضاعف التحول الجيومترية.
order
MatrixOrder
A Aspose.Imaging.MatrixOrder الذي يحدد من أجل تضاعف اثنين من المصفوفات.
ResetTransform()
إعادة تعيين Aspose.Imaging.Graphics.تحويل الممتلكات إلى الهوية.
public void ResetTransform()
RotateTransform(السفينة)
يدور التحول الجيومترية المحلية بالكمية المحددة.هذا الأسلوب يرفع الدوران إلى التحول.
public void RotateTransform(float angle)
Parameters
angle
float
زاوية الدوران .
RotateTransform(الطائرات، MatrixOrder)
يدور التحول الهندسي المحلي بالكمية المحددة في الترتيب المحدد.
public void RotateTransform(float angle, MatrixOrder order)
Parameters
angle
float
زاوية الدوران .
order
MatrixOrder
Aspose.Imaging.MatrixOrder الذي يحدد ما إذا كان لتوصيل أو توصيل المصفوفة الدوارة.
ScaleTransform(السفينة، السفينة)
تقسيم التحول الجيومترية المحلية حسب الكميات المحددة.هذه الطريقة تقسيم المصفوفة إلى التحول.
public void ScaleTransform(float sx, float sy)
Parameters
sx
float
الكمية التي من أجل تقسيم التحول في اتجاه محور x.
sy
float
الكمية التي من أجل تقسيم التحول في اتجاه y-axis.
ScaleTransform(السفينة، السفينة، MatrixOrder)
تقسيم التحول الجيومترية المحلية بالكمية المحددة في الترتيب المحدد.
public void ScaleTransform(float sx, float sy, MatrixOrder order)
Parameters
sx
float
الكمية التي من أجل تقسيم التحول في اتجاه محور x.
sy
float
الكمية التي من أجل تقسيم التحول في اتجاه y-axis.
order
MatrixOrder
A Aspose.Imaging.MatrixOrder الذي يحدد ما إذا كان لتوصيل أو توصيل المصفوفة.
TranslateTransform(السفينة، السفينة)
يترجم التحول الجيومتركي المحلي حسب الأبعاد المحددة.هذه الطريقة تفرض الترجمة على التحول.
public void TranslateTransform(float dx, float dy)
Parameters
dx
float
قيمة الترجمة في x.
dy
float
قيمة الترجمة في y.
TranslateTransform(السفينة، السفينة، MatrixOrder)
ترجمة التحول الجيومترية المحلية حسب الأبعاد المحددة في الترتيب المحدد.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
قيمة الترجمة في x.
dy
float
قيمة الترجمة في y.
order
MatrixOrder
أوامر (مرفقة أو مرفقة) التي تطبق فيها الترجمة.