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; }
ارزش املاک
Dpix
به دست آوردن رزولوشن افقی از این Aspose.Imaging.Graphics.
public float DpiX { get; }
ارزش املاک
دبی
رزولوشن عمودی این Aspose.Imaging.Graphics را دریافت کنید.
public float DpiY { get; }
ارزش املاک
Image
تصویر را می گیرد.
public Image Image { get; }
ارزش املاک
InterpolationMode
به حالت Interpolation وارد می شود یا تنظیم می شود.
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
توجه داشته باشید تاثیرات پس از شروع به روز رسانی فراخوان داده می شود در صورتی که پایان به روز رسانی فراخوان داده نمی شود اعمال نخواهد شد.
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
هماهنگی Y از نقطه شروع منحنی
x2
float
هماهنگی x از اولین نقطه کنترل منحنی.
y2
float
هماهنگی y از نقطه کنترل اول منحنی.
x3
float
هماهنگی x از نقطه کنترل دوم منحنی.
y3
float
هماهنگی Y نقطه کنترل دوم منحنی است.
x4
float
هماهنگی x نقطه پایان منحنی
y4
float
هماهنگی Y از نقطه پایان منحنی
Exceptions
pen’ is null.
DrawBezier(پین، PointF، PointF، PointF)
یک خط 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(پین، PointF[])
یک سری از خطوط 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(پین، 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 که spline را تعریف می کند.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(پین، PointF[ ], کشتی)
کشیدن یک خط کاردینال بسته تعریف شده توسط مجموعه ای از ساختارهای 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 که spline را تعریف می کند.
tension
float
ارزش بزرگتر یا برابر با 0.0F است که تنش منحنی را مشخص می کند.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(نمره، نقطه[])
این روش از تنش پیش فرض 0.5 و حالت پر کردن Aspose.Imaging.FillMode.Alternate استفاده می کند.
public void DrawClosedCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen که رنگ، عرض و ارتفاع منحنی را تعیین می کند.
points
Point
[ ]
مجموعه ای از ساختارهای Aspose.Imaging.Point که spline را تعریف می کند.
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 که spline را تعریف می کند.
tension
float
ارزش بزرگتر یا برابر با 0.0F است که تنش منحنی را مشخص می کند.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(پین، PointF[])
یک خط کاردینال را از طریق طیف مشخصی از ساختارهای Aspose.Imaging.PointF کشیده می شود.این روش از تنش پیش فرض 0.5 استفاده می کند.
public void DrawCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen که رنگ، عرض و ارتفاع منحنی را تعیین می کند.
points
PointF
[ ]
مجموعه ای از ساختارهای Aspose.Imaging.PointF که spline را تعریف می کند.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(پین، PointF[ ], کشتی)
یک خط کاردینال را از طریق یک سری مشخص از ساختارهای 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(پین، PointF[ ], int , int)
یک خط کاردینال را از طریق یک سری مشخص از ساختارهای 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 که spline را تعریف می کند.
offset
int
از عنصر اول در ردیف پارامتر points به نقطه شروع در منحنی خارج می شود.
numberOfSegments
int
تعداد بخش ها پس از نقطه شروع برای شامل در منحنی.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(پین، PointF[ ], 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 که spline را تعریف می کند.
offset
int
از عنصر اول در ردیف پارامتر points به نقطه شروع در منحنی خارج می شود.
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 که spline را تعریف می کند.
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 که spline را تعریف می کند.
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 که spline را تعریف می کند.
offset
int
از عنصر اول در ردیف پارامتر points به نقطه شروع در منحنی خارج می شود.
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(قلم، Rectangle)
یک الیپس مشخص شده توسط یک ساختار محدوده 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(پین، int، int، int، int)
درایو یک الیپس تعریف شده توسط یک مستطیل مرزی مشخص شده توسط یک جفت هماهنگی، یک ارتفاع و یک عرض.
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(تصویر، PointF)
تصویر مشخص شده 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، گرافیک)
تصویر مشخص شده 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، گرافیک)
تصویر مشخص شده 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 , گرافیک)
بخش مشخص شده از تصویر " را در محل مشخص شده و با اندازه مشخص شده نشان دهید.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
تصویر برای نقاشی
destPoints
Point
[ ]
مجموعه ای از سه ساختار PointF که یک پارالوگرافی را تعریف می کنند.
srcRect
Rectangle
منبع مستقیم است.
srcUnit
GraphicsUnit
واحد های اندازه گیری
DrawImage(تصویر، نقطه[ ], Rectangle , GraphicsUnit , تصاویر)
بخش مشخص شده از تصویر " را در محل مشخص شده و با اندازه مشخص شده نشان دهید.
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(تصویر، PointF[])
بخش مشخص شده از تصویر " را در محل مشخص شده و با اندازه مشخص شده نشان دهید.
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
تصویر برای نقاشی
destPoints
PointF
[ ]
مجموعه ای از سه ساختار PointF که یک پارالوگرافی را تعریف می کنند.
Exceptions
تصویر
DrawImage(تصویر، PointF[ ], Rectangle)
بخش مشخص شده از تصویر " را در محل مشخص شده و با اندازه مشخص شده نشان دهید.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
تصویر برای نقاشی
destPoints
PointF
[ ]
مجموعه ای از سه ساختار PointF که یک پارالوگرافی را تعریف می کنند.
srcRect
RectangleF
منبع مستقیم است.
DrawImage(تصویر، PointF[ ], RectangleF , گرافیک)
بخش مشخص شده از تصویر " را در محل مشخص شده و با اندازه مشخص شده نشان دهید.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
تصویر برای نقاشی
destPoints
PointF
[ ]
مجموعه ای از سه ساختار PointF که یک پارالوگرافی را تعریف می کنند.
srcRect
RectangleF
منبع مستقیم است.
srcUnit
GraphicsUnit
واحد های اندازه گیری
DrawImage(تصویر، PointF[ ], 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(پین، PointF، PointF)
یک خط را که دو ساختار 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(پین، int، int، int، int)
یک خط را که دو نقطه را که توسط جفت هماهنگی مشخص شده است، به هم متصل می کند.
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(پین، PointF[])
مجموعه ای از بخش های خطی را که مجموعه ای از ساختارهای 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(گرافیک، گرافیک)
دانلود نرم افزار 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(پین، PointF[])
کشیدن یک پلیگون تعریف شده توسط مجموعه ای از ساختارهای 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(قلم، Rectangle)
یک مستطیل مشخص شده توسط یک ساختار 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
هماهنگی Y از گوشه سمت چپ بالا از مستطیل برای کشیدن.
width
float
پهنای باند دایره ای برای کشیدن است.
height
float
ارتفاع دایره ای که باید کشیده شود
Exceptions
pen’ is null.
DrawRectangle(پین، int، int، int، int)
کشیدن یک مستطیل مشخص شده توسط یک جفت هماهنگی، یک عرض و یک ارتفاع.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen که رنگ، عرض و سبک راست را تعیین می کند.
x
int
هماهنگی x از گوشه بالا سمت چپ مستطیل برای کشیدن.
y
int
هماهنگی Y از گوشه سمت چپ بالا از مستطیل برای کشیدن.
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(قلم، Rectangle[])
یک سری از مستطیلات مشخص شده توسط Aspose.Imaging.Rectangle ساختار.
public void DrawRectangles(Pen pen, Rectangle[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen که رنگ، عرض و سبک خطوط مستطیل را تعیین می کند.
rects
Rectangle
[ ]
مجموعه ای از ساختارهای Aspose.Imaging.Rectangle که نشان دهنده مستطیل برای کشیدن است.
Examples
این مثال نشان دهنده ایجاد و استفاده از اشیاء پن است.این مثال یک تصویر جدید ایجاد می کند و Rectangles را بر روی سطح تصویر کشیده است.
//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(برش، فونت، 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(فاکتور، فاکتور، فاکتور، فاکتور، فاکتور)
خط متن مشخص شده را در محل مشخص شده با اشیاء مشخص شده 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(برچسب ها: StringFormat، PointF، Brush، 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(برچسب ها: StringFormat، StringFormat، StringFormat)
نوار متن مشخص شده را در مستطیل مشخص شده با اشیاء 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()
کارهای گرافیکی که پس از شروع شروع به کار آغاز می شود، به پایان می رسد.کارهای گرافیکی قبلی در هنگام تماس با این روش به طور همزمان اعمال می شود.
public void EndUpdate()
FillClosedCurve(برش، 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 که spline را تعریف می کند.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(برش، PointF[ ], پر کردن)
پر کردن داخل یک منحنی کاردینال بسته تعریف شده توسط مجموعه ای از ساختارهای Aspose.Imaging.PointF با استفاده از حالت پر کردن مشخص شده.این روش با استفاده از تنش پیش فرض 0.5.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush که مشخصات پر کردن را تعیین می کند.
points
PointF
[ ]
مجموعه ای از ساختارهای Aspose.Imaging.PointF که spline را تعریف می کند.
fillMode
FillMode
عضو فهرست Aspose.Imaging.FillMode است که تعیین می کند که چگونه منحنی پر می شود.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(برش، PointF[ ], FillMode , پرواز)
پر کردن داخل یک منحنی کاردینال بسته تعریف شده توسط مجموعه ای از ساختارهای 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 که spline را تعریف می کند.
fillmode
FillMode
عضو فهرست Aspose.Imaging.FillMode است که تعیین می کند که چگونه منحنی پر می شود.
tension
float
ارزش بزرگتر یا برابر با 0.0F است که تنش منحنی را مشخص می کند.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(برش، نقطه[])
این روش از تنش پیش فرض 0.5 و حالت پر کردن Aspose.Imaging.FillMode.Alternate استفاده می کند.
public void FillClosedCurve(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush که مشخصات پر کردن را تعیین می کند.
points
Point
[ ]
مجموعه ای از ساختارهای Aspose.Imaging.Point که spline را تعریف می کند.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(برش، نقطه[ ], پر کردن)
پر کردن داخل یک منحنی کاردینال بسته تعریف شده توسط یک سری از ساختارهای Aspose.Imaging.Point با استفاده از حالت پر کردن مشخص شده. این روش با استفاده از تنش پیش فرض 0.5.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)
Parameters
brush
Brush
Aspose.Imaging.Brush که مشخصات پر کردن را تعیین می کند.
points
Point
[ ]
مجموعه ای از ساختارهای Aspose.Imaging.Point که spline را تعریف می کند.
fillmode
FillMode
عضو فهرست Aspose.Imaging.FillMode است که تعیین می کند که چگونه منحنی پر می شود.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(برش، نقطه[ ], FillMode , پرواز)
پر کردن داخل یک منحنی کاردینال بسته تعریف شده توسط مجموعه ای از ساختارهای 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 که spline را تعریف می کند.
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(برش، int، int، int، int)
پر کردن داخل یک الیپس تعریف شده توسط یک مستطیل مرزی مشخص شده توسط یک جفت هماهنگی، عرض و ارتفاع.
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(برش، گرافیک)
در داخل یک Aspose.Imaging.GraphicsPath قرار دارد.
public void FillPath(Brush brush, GraphicsPath path)
Parameters
brush
Brush
Aspose.Imaging.Brush که مشخصات پر کردن را تعیین می کند.
path
GraphicsPath
Aspose.Imaging.GraphicsPath که نشان دهنده مسیر برای پر کردن است.
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، Float، Float)
پر کردن داخل یک بخش پیا تعریف شده توسط یک الیپس مشخص شده توسط یک ساختار 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(برش، int، int، int، int، int)
پر کردن داخل یک بخش پیا تعریف شده توسط یک الیپس مشخص شده توسط یک جفت هماهنگی، یک عرض، یک ارتفاع و دو خط رادیال.
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(برش، PointF[])
پر کردن داخل یک پلیگون تعریف شده توسط طیف وسیعی از نقاط مشخص شده توسط ساختارهای 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(برش، PointF[ ], پر کردن)
پر کردن داخل یک پلیگون تعریف شده توسط طیف وسیعی از نقاط مشخص شده توسط ساختارهای 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(برش، int، int، int، int)
پر کردن داخل یک مستطیل مشخص شده توسط یک جفت هماهنگی، عرض و ارتفاع.
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.Region که نشان دهنده منطقه برای پر کردن است.
Exceptions
brush’ is null.-or-
region’ is null.
~Graphics()
protected ~Graphics()
MeasureString(تگ ها، تگ ها، تگ ها، تگ ها)
اندازه گیری نوار متن با پارامترهای مشخص شده
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(ماتریکس، ماتریکس)
Aspose.Imaging.Matrix که نشان دهنده تحول جغرافیایی محلی این Aspose.Imaging.Graphics توسط Aspose.Imaging.Matrix مشخص شده در ترتیب مشخص شده است.
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
Aspose.Imaging.Matrix که با آن برای تکثیر تحول ژئومتریک.
order
MatrixOrder
یک Aspose.Imaging.MatrixOrder که مشخص می کند که برای چند برابر کردن دو ماتریس.
ResetTransform()
بازگرداندن Aspose.Imaging.Graphics.Transform property to identity.
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-axis.
sy
float
مقدار که در آن برای مقیاس تبدیل در جهت y-axis.
ScaleTransform(فلوت، فلوت، ماتریکس)
محدوده تحول جغرافیایی محلی را با مقدار مشخص شده در ترتیب مشخص شده مقیاس دهید.
public void ScaleTransform(float sx, float sy, MatrixOrder order)
Parameters
sx
float
مقدار که در آن برای مقیاس تبدیل در جهت x-axis.
sy
float
مقدار که در آن برای مقیاس تبدیل در جهت y-axis.
order
MatrixOrder
یک Aspose.Imaging.MatrixOrder که مشخص می کند که آیا برای اضافه کردن یا اضافه کردن ماتریس مقیاس.
TranslateTransform(کشتی، کشتی)
ترجمه ترجمه جغرافیایی محلی با توجه به ابعاد مشخص شده این روش ترجمه را به ترجمه متصل می کند.
public void TranslateTransform(float dx, float dy)
Parameters
dx
float
ارزش ترجمه در x.
dy
float
ارزش ترجمه در Y
TranslateTransform(فلوت، فلوت، ماتریکس)
ترجمه تحول جغرافیایی محلی با ابعاد مشخص شده در ترتیب مشخص شده.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
ارزش ترجمه در x.
dy
float
ارزش ترجمه در Y
order
MatrixOrder
دستور (prepend یا append) که در آن ترجمه اعمال می شود.