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
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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.Графике.
public Graphics(Image sourceImage)
Parameters
sourceImage
Image
Извор слике .
Properties
Clip
Добијете или постављате клип регион.
public Region Clip { get; set; }
Вредност имовине
CompositingQuality
Добија или поставља композитну квалитет.
public CompositingQuality CompositingQuality { get; set; }
Вредност имовине
ДПИКС
Добија хоризонталну резолуцију овог Aspose.Imaging.Графике.
public float DpiX { get; }
Вредност имовине
ДПИ
Добија вертикалну резолуцију овог Aspose.Imaging.Графике.
public float DpiY { get; }
Вредност имовине
Image
Добије слику.
public Image Image { get; }
Вредност имовине
InterpolationMode
Добија или поставља режим интерполације.
public InterpolationMode InterpolationMode { get; set; }
Вредност имовине
IsInBeginUpdateCall
Добија вредност која указује на то да ли је график у стању позива BeginUpdate.
public bool IsInBeginUpdateCall { get; }
Вредност имовине
PageScale
Добијете или постављате скалирање између светских јединица и јединице странице за овај Aspose.Imaging.Графике.
public float PageScale { get; set; }
Вредност имовине
PageUnit
Добијете или постављате јединицу мерења која се користи за координате странице у овом Aspose.Imaging.Графике.
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.Графике.
public Matrix Transform { get; set; }
Вредност имовине
Methods
BeginUpdate()
Почиње кеширање следећих графичких операција. графички ефекти који се примењују касније неће се примењивати одмах уместо тога, EndUpdate ће изазвати примењивање свих ефеката одједном.
public void BeginUpdate()
Remarks
Имајте на уму да ефекти након што се позива BeginUpdate неће се применити у случају да се не позива EndUpdate.
Clear(Color)
Чисти графичку површину користећи одређену боју.
public void Clear(Color color)
Parameters
color
Color
Боја за чишћење графичке површине.
Examples
Ови примери користе GraphicsPath и График класе да креирају и манипулишу Слике на површини слике. Пример ствара нову слику (тип Тифф), чисти површина и увлачи путеве уз помоћ Класе ГрафикаПатх.
//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();
}
}
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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.Пен који одређује боју, ширину и стил лука.
x
float
Кс-координат у горњем левом углу правоугаоника који дефинише елипсу.
y
float
И-координат врхунско-левог угла правоугао који дефинише елипсу.
width
float
Ширина правоугаоника која дефинише елипсу.
height
float
Висина правоугао који дефинише елипсу.
startAngle
float
Угао у степенима мери се са часовима од х-аксиса до почетног тачка лука.
sweepAngle
float
Угао у степенима се мери са часовима из параметара <код класа=“paramref”>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.Пен који одређује боју, ширину и стил лука.
rect
RectangleF
Aspose.Imaging.RectangleF структура која дефинише границе елипсе.
startAngle
float
Угао у степенима мери се са часовима од х-аксиса до почетног тачка лука.
sweepAngle
float
Угао у степенима се мери са часовима из параметара <код класа=“paramref”>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.Пен који одређује боју, ширину и стил лука.
x
int
Кс-координат у горњем левом углу правоугаоника који дефинише елипсу.
y
int
И-координат врхунско-левог угла правоугао који дефинише елипсу.
width
int
Ширина правоугаоника која дефинише елипсу.
height
int
Висина правоугао који дефинише елипсу.
startAngle
int
Угао у степенима мери се са часовима од х-аксиса до почетног тачка лука.
sweepAngle
int
Угао у степенима се мери са часовима из параметара <код класа=“paramref”>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.Пен који одређује боју, ширину и стил лука.
rect
Rectangle
Aspose.Imaging.RectangleF структура која дефинише границе елипсе.
startAngle
float
Угао у степенима мери се са часовима од х-аксиса до почетног тачка лука.
sweepAngle
float
Угао у степенима се мери са часовима из параметара <код класа=“paramref”>startAngle’ до завршетка тачке лука.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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(пена, флота, флота, флота, флота, флота, флота, флота, флота)
Дизајнира Безиер сплине дефинисане четири наручене паре координати који представљају тачке.
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.Пен који одређује боју, ширину и стил кривине.
x1
float
Кс-координат излазне тачке кривине.
y1
float
И-координат излазне тачке кривине.
x2
float
Кс-координат прве контролне тачке кривине.
y2
float
И-координат прве контролне тачке кривине.
x3
float
Кс-координат другог контролног тачка кривине.
y3
float
И-координат другог контролног тачка кривине.
x4
float
Кс-координат завршне тачке кривине.
y4
float
И-координат завршне тачке кривине.
Exceptions
pen’ is null.
DrawBezier(Пинк, ПоинтФ, ПоинтФ, ПоинтФ)
Дизајнира Безиер сплине дефинисане четири структуре Aspose.Imaging.PointF.
public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил кривине.
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(Точка, тачка, тачка, тачка)
Дизајнира Безиер сплине дефинисане четири Aspose.Imaging.Поинт структуре.
public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
Parameters
pen
Pen
Aspose.Imaging.Пен структура која одређује боју, ширину и стил кривине.
pt1
Point
Aspose.Imaging.Точка структура која представља почетну тачку кривине.
pt2
Point
Aspose.Imaging.Точка структура која представља прву контролну тачку за кривину.
pt3
Point
Aspose.Imaging.Точка структура која представља другу контролну тачку за кривину.
pt4
Point
Aspose.Imaging.Точка структура која представља крајну тачку кривине.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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(КСНУМКС тачка[])
Снима серију Безиер сплине из низ структура Aspose.Imaging.Поинт.
public void DrawBeziers(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил кривине.
points
Point
[]
Поремећај Aspose.Imaging.Точке структуре које представљају тачке које одређују кривину.
Exceptions
pen’ is null.-or-
points’ is null.
DrawBeziers(КСНУМКС, PointF[])
Снима серију Безиер сплине из низ структура Aspose.Imaging.PointF.
public void DrawBeziers(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које представљају тачке које одређују кривину.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(КСНУМКС, PointF[])
Укључује затворену кардиналну сплину која је дефинисана низ структура Aspose.Imaging.PointF. Овај метод користи подразумевани напетост од 0.5 и Wl17.FillMode.Alternate режим пуњења.
public void DrawClosedCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(КСНУМКС, PointF[], Флоат)
Укључује затворену кардиналну сплину која је дефинисана низ структура Aspose.Imaging.PointF користећи одређену напетост. Овај метод користи подразумевани режим за попуњавање _ВЛ17.FillMode.Alternate
public void DrawClosedCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(КСНУМКС тачка[])
Укључује затворену кардиналну сплину која је дефинисана низ структура Aspose.Imaging.Поинт.Овај метод користи подразумевани напон од 0.5 и _ВЛ17.FillMode.Alternate режим пуњења.
public void DrawClosedCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(КСНУМКС тачка[], Флоат)
Нацртање затворене кардиналне сплине дефинисане низ Aspose.Imaging.Поинт структуре користећи одређену напетост.Овај метод користи подразумевани режим за попуњавање Wl17.FillMode.Alternate
public void DrawClosedCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
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.Пен који одређује боју, ширину и висину кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
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.Пен који одређује боју, ширину и висину кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које представљају тачке које дефинишу кривину.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
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.Пен који одређује боју, ширину и висину кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
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.Пен који одређује боју, ширину и висину кривине.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
offset
int
Одвојите од првог елемента у реду параметара points’ до почетног тачка у кривини.
numberOfSegments
int
Број сегмената након почетне тачке да се укључи у кривину.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(КСНУМКС тачка[])
Навлачи кардиналну сплину кроз одређену линију структура Aspose.Imaging.Поинт.
public void DrawCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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.Поинт структура користећи одређено напетост.
public void DrawCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(КСНУМКС тачка[], int , int , float)
Привлачи кардиналну сплину кроз одређену линију Aspose.Imaging.Поинт структура користећи одређено напетост.
public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и висину кривине.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
offset
int
Одвојите од првог елемента у реду параметара points’ до почетног тачка у кривини.
numberOfSegments
int
Број сегмената након почетне тачке да се укључи у кривину.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
Exceptions
pen’ is null.-or-
points’ is null.
DrawEllipse(Пин, Ректанглеф)
Снима елипсе дефинисане граничним Aspose.Imaging.RectangleF.
public void DrawEllipse(Pen pen, RectangleF rect)
Parameters
pen
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
Пен који одређује боју, ширину и стил елипса.
x
float
Кс-координат у горњем левом углу граничног правоугаоника који дефинише елипсу.
y
float
И-координат врхунско-левог угла граничног правоугаоника који дефинише елипсу.
width
float
Ширина граничног правоугаоника који дефинише елипсу.
height
float
Висина граничног правоугаоника који дефинише елипсу.
Exceptions
pen’ is null.
DrawEllipse(Пинк, правоугао)
Причвршћује елипсу која је одређена граничном структуром Aspose.Imaging.Rectangle.
public void DrawEllipse(Pen pen, Rectangle rect)
Parameters
pen
Pen
Пен који одређује боју, ширину и стил елипса.
rect
Rectangle
WL17_.Ректоугао структура која дефинише границе елипсе.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawEllipse(Пин, инт, инт, инт)
Навлачи елипсу дефинисану граничним правоугаоном који је одређен паром координати, висином и ширином.
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Пен који одређује боју, ширину и стил елипса.
x
int
Кс-координат у горњем левом углу граничног правоугаоника који дефинише елипсу.
y
int
И-координат врхунско-левог угла граничног правоугаоника који дефинише елипсу.
width
int
Ширина граничног правоугаоника који дефинише елипсу.
height
int
Висина граничног правоугаоника који дефинише елипсу.
Exceptions
pen’ is null.
DrawImage(Слика, ПоинтФ)
Нацртајте одређену Aspose.Imaging.Graphics.Image, користећи његову оригиналну физичку величину, на одређеном месту.
public void DrawImage(Image sourceImage, PointF point)
Parameters
sourceImage
Image
Слике које треба да нацртају.
point
PointF
Aspose.Imaging.PointF структура која представља горњи леви угао нацртане слике.
Exceptions
sourceImage’ is null.
DrawImage(Слика, пловидба, пловидба)
Нацртајте одређену Aspose.Imaging.Graphics.Image, користећи његову оригиналну физичку величину, на одређеном месту.
public void DrawImage(Image sourceImage, float x, float y)
Parameters
sourceImage
Image
Слике које треба да нацртају.
x
float
Кс-координат у горњем левом углу слике.
y
float
И-координат врхунско-левог угла нацртане слике.
Exceptions
sourceImage’ is null.
DrawImage(Слика, Ректанглеф)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, RectangleF rect)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rect
RectangleF
Aspose.Imaging.RectangleF структура која одређује локацију и величину нацртаног слике.
Exceptions
sourceImage’ is null.
DrawImage(Слика, Ректангле, ГрафикУни)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rectDestination
Rectangle
Дестинација је правоугао.
graphicsUnit
GraphicsUnit
Јединство за графику.
Exceptions
sourceImage’ is null.
DrawImage(Слика, RectangleF, GraphicsUnit)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rectDestination
RectangleF
Дестинација је правоугао.
graphicsUnit
GraphicsUnit
Јединство за графику.
Exceptions
sourceImage’ is null.
DrawImage(Слика, Ректанг, ГрафицУнит, СликаАтрибутес)
Нацртајте одређену 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(Слика, Ректангле, Ректангле, График)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rectSource
Rectangle
Извор је право.
rectDestination
Rectangle
У правцу дестинације.
graphicsUnit
GraphicsUnit
Јединство за графику.
Exceptions
sourceImage’ is null.
DrawImage(Слика, RectangleF, RectangleF, GraphicsUnit)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rectSource
RectangleF
Извор је право.
rectDestination
RectangleF
У правцу дестинације.
graphicsUnit
GraphicsUnit
Јединство за графику.
Exceptions
sourceImage’ is null.
DrawImage(Image, 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(Слика, тачка[])
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, Point[] destPoints)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
Point
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
DrawImage(Слика, тачка[], правоугао)
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
Point
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
srcRect
Rectangle
изворног правоугаоника.
DrawImage(Слика, тачка[], Ректангле, ГрафицУнит)
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
Point
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
srcRect
Rectangle
изворног правоугаоника.
srcUnit
GraphicsUnit
јединице мерења.
DrawImage(Слика, тачка[], Ректангле, ГрафикУнит, ИмиџАтрибутес)
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
Point
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
srcRect
Rectangle
изворног правоугаоника.
srcUnit
GraphicsUnit
јединице мерења.
imageAttributes
ImageAttributes
Слика има атрибуте.
DrawImage(Слика, ПоинтФ[])
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
PointF
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
Exceptions
Слика
DrawImage(Слика, ПоинтФ[], Ректанглеф)
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
PointF
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
srcRect
RectangleF
изворног правоугаоника.
DrawImage(Слика, ПоинтФ[], RectangleF, GraphicsUnit)
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
PointF
[]
Постоје три ПоинтФ структуре које дефинишу паралелограм.
srcRect
RectangleF
изворног правоугаоника.
srcUnit
GraphicsUnit
јединице мерења.
DrawImage(Слика, ПоинтФ[], RectangleF, GraphicsUnit, ImageAttributes)
Нацртајте одређени део одређене <код класе=“paramref”> слике’ на одређеном месту и са одређеном величином.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Слике које треба да нацртају.
destPoints
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
Кс-координат у горњем левом углу слике.
y
float
И-координат врхунско-левог угла нацртане слике.
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.Точка структура која представља локацију горњег левог угла нацртаног слике.
Exceptions
sourceImage’ is null.
DrawImage(Слике, инт, инт)
Снима одређену слику, користећи његову оригиналну физичку величину, на локацији која је одређена координатним паром.
public void DrawImage(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Слике које треба да нацртају.
x
int
Кс-координат у горњем левом углу слике.
y
int
И-координат врхунско-левог угла нацртане слике.
Exceptions
sourceImage’ is null.
DrawImage(Слике, правоугао)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rect
Rectangle
Aspose.Imaging.Rectangle struktura koja navodi lokaciju i veličinu snimljenog slika.
Exceptions
sourceImage’ is null.
DrawImage(Слика, инт, инт, инт)
Нацртајте одређену Aspose.Imaging.Graphics.Image на одређеном месту и са наведеном величином.
public void DrawImage(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Слике које треба да нацртају.
x
int
Кс-координат у горњем левом углу слике.
y
int
И-координат врхунско-левог угла нацртане слике.
width
int
Ширина уграђене слике.
height
int
Висина уграђене слике.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Слика, тачка)
Снима одређену слику користећи његову оригиналну физичку величину на одређеном месту.
public void DrawImageUnscaled(Image sourceImage, Point point)
Parameters
sourceImage
Image
Слике које треба да нацртају.
point
Point
Aspose.Imaging.Точка структура која одређује горњи леви угао нацртане слике.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Слике, инт, инт)
Снима одређену слику користећи његову оригиналну физичку величину на локацији која је одређена координатним паром.
public void DrawImageUnscaled(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Слике које треба да нацртају.
x
int
Кс-координат у горњем левом углу слике.
y
int
И-координат врхунско-левог угла нацртане слике.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Слике, правоугао)
Снима одређену слику користећи његову оригиналну физичку величину на одређеном месту.
public void DrawImageUnscaled(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rect
Rectangle
Aspose.Imaging.Ректанг који указује на горњи леви угао слике.Х и И својства правог угла указују на врхунско лево.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Слика, инт, инт, инт)
Снима одређену слику користећи његову оригиналну физичку величину на одређеном месту.
public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Слике које треба да нацртају.
x
int
Кс-координат у горњем левом углу слике.
y
int
И-координат врхунско-левог угла нацртане слике.
width
int
Параметар се не користи.
height
int
Параметар се не користи.
Exceptions
sourceImage’ is null.
DrawImageUnscaledAndClipped(Слике, правоугао)
Нацртајте одређену слику без скалације и клипирајте је, ако је потребно, да би се прилагодио одређеном правоугао.
public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Слике које треба да нацртају.
rect
Rectangle
Aspose.Imaging.Rectangle у којем да нацртају слику.
Exceptions
sourceImage’ is null.
DrawLine(Точка, тачка и тачка)
Снима линију која повезује две структуре Aspose.Imaging.Поинт.
public void DrawLine(Pen pen, Point point1, Point point2)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил линије.
point1
Point
Aspose.Imaging.Точка структура која представља прву тачку за повезивање.
point2
Point
Aspose.Imaging.Точка структура која представља другу тачку за повезивање.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawLine(Пинк, ПоинтФ, ПоинтФ)
Снима линију која повезује две структуре Aspose.Imaging.PointF.
public void DrawLine(Pen pen, PointF point1, PointF point2)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил линије.
point1
PointF
Aspose.Imaging.PointF структура која представља прву тачку за повезивање.
point2
PointF
Aspose.Imaging.PointF структура која представља другу тачку за повезивање.
Exceptions
pen’ is null.
DrawLine(Пин, инт, инт, инт)
Навлачи линију која повезује две тачке одређене координатним паровима.
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил линије.
x1
int
КСНУМКС координати прве тачке.
y1
int
Координација прве тачке.
x2
int
КСНУМКС координати другог тачка.
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.Пен који одређује боју, ширину и стил линије.
x1
float
КСНУМКС координати прве тачке.
y1
float
Координација прве тачке.
x2
float
КСНУМКС координати другог тачка.
y2
float
И-координат у другој тачки.
Exceptions
pen’ is null.
DrawLines(КСНУМКС тачка[])
Нацрта серија линијских сегмената који повезују низ Aspose.Imaging.Point структура.
public void DrawLines(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил сегмената линије.
points
Point
[]
Поремећај Aspose.Imaging.Точка структуре које представљају тачке које треба повезати.
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.Пен који одређује боју, ширину и стил сегмената линије.
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.Пен који одређује боју, ширину и стил пута.
path
GraphicsPath
Aspose.Imaging.GrafikaPath za crtanje.
Examples
Ови примери користе 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.Пен који одређује боју, ширину и стил облика пије.
rect
RectangleF
Aspose.Imaging.RectangleF структура која представља гранични правоугао који дефинише елипсу из којег долази облик пије.
startAngle
float
Угао се мери у степенима са часовима од х-аксиса до прве стране облика пије.
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.Пен који одређује боју, ширину и стил облика пије.
x
float
Кс-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази облик пије.
y
float
И-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази облик пије.
width
float
Ширина граничног правоугаоника који дефинише елипсу из којег долази облик пије.
height
float
Висина граничног правоугаоника који дефинише елипсу из којег долази облик пије.
startAngle
float
Угао се мери у степенима са часовима од х-аксиса до прве стране облика пије.
sweepAngle
float
Угао се мери у степенима са часовима од параметара startAngle’ на другу страну облика пије.
Exceptions
pen’ is null.
DrawPie(Пена, правоугао, плута, плута)
Дизајнира пеј облик дефинисан елипсом који је одређен Aspose.Imaging.Ректунгл структуром и две радијалне линије.
public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил облика пије.
rect
Rectangle
WL17_.Ректангулна структура која представља гранични правоугао који дефинише елипсу из којег долази облик пије.
startAngle
float
Угао се мери у степенима са часовима од х-аксиса до прве стране облика пије.
sweepAngle
float
Угао се мери у степенима са часовима од параметара startAngle’ на другу страну облика пије.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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.Пен који одређује боју, ширину и стил облика пије.
x
int
Кс-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази облик пије.
y
int
И-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази облик пије.
width
int
Ширина граничног правоугаоника који дефинише елипсу из којег долази облик пије.
height
int
Висина граничног правоугаоника који дефинише елипсу из којег долази облик пије.
startAngle
int
Угао се мери у степенима са часовима од х-аксиса до прве стране облика пије.
sweepAngle
int
Угао се мери у степенима са часовима од параметара startAngle’ на другу страну облика пије.
Exceptions
pen’ is null.
DrawPolygon(КСНУМКС, PointF[])
Навлачи полигон дефинисан низ структура Aspose.Imaging.PointF.
public void DrawPolygon(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил полигона.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које представљају вертикале полигона.
Exceptions
pen’ is null.-or-
points’ is null.
DrawPolygon(КСНУМКС тачка[])
Навлачи полигон дефинисан низ структура Aspose.Imaging.Поинт.
public void DrawPolygon(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил полигона.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које представљају вертикале полигона.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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(Пин, Ректанглеф)
Причвршћује правоугао одређен структуром Aspose.Imaging.RectangleF.
public void DrawRectangle(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил правоугао.
rect
RectangleF
Структура Aspose.Imaging.RectangleF која представља правоугао за цртање.
Exceptions
pen’ is null.
DrawRectangle(Пинк, правоугао)
Причвршћује правоугао који је одређен структуром Aspose.Imaging.Rectangle.
public void DrawRectangle(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил правоугао.
rect
Rectangle
Aspose.Imaging.Rectangle структура која представља правоугао за цртање.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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.Пен који одређује боју, ширину и стил правоугао.
x
float
Кс-координат врхунско-левог угла правоугаоца за цртање.
y
float
И-координат врхунско-левог угла правоугаоца за цртање.
width
float
Ширина правоугаоника за цртање.
height
float
Висина правоугаоника да се нацрта.
Exceptions
pen’ is null.
DrawRectangle(Пин, инт, инт, инт)
Навлачи правоугао који је одређен координатним паром, ширином и висином.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил правоугао.
x
int
Кс-координат врхунско-левог угла правоугаоца за цртање.
y
int
И-координат врхунско-левог угла правоугаоца за цртање.
width
int
Ширина правоугаоника за цртање.
height
int
Висина правоугаоника за цртање.
Exceptions
pen’ is null.
DrawRectangles(Пин, Ректанглеф[])
Дизајнира серија правоугаоника одређених Aspose.Imaging.RectangleF структурама.
public void DrawRectangles(Pen pen, RectangleF[] rects)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил излаза правоугаоника.
rects
RectangleF
[]
Поремећај Aspose.Imaging.RectangleF структура које представљају правоугао за цртање.
Exceptions
pen’ is null.-or-
rects’ is null.
DrawRectangles(Пинк, правоугао[])
Дизајнира серија правоугаоника која је одређена Aspose.Imaging.Rectangle структурама.
public void DrawRectangles(Pen pen, Rectangle[] rects)
Parameters
pen
Pen
Aspose.Imaging.Пен који одређује боју, ширину и стил излаза правоугаоника.
rects
Rectangle
[]
Поремећај Aspose.Imaging.Ректунгалне структуре које представљају правоугаоце за цртање.
Examples
Овај пример показује стварање и коришћење Пен објеката. Пример ствара нову слику и црта Ректангеле на површини слике.
//Create an instance of BmpOptions and set its various properties
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
//Second Boolean parameter determines if the file to be created IsTemporal or not
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Create an instance of Image at specified Path
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Create an instance of Graphics and initialize it with Image object
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear the Graphics sutface with White Color
graphics.Clear(Aspose.Imaging.Color.White);
//Create an instance of Pen with color Red and width 5
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//Create an instance of HatchBrush and set its properties
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Create an instance of Pen
//initialize it with HatchBrush object and width
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(pen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
});
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(brusedpen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
});
// save all changes.
image.Save();
}
Exceptions
pen’ is null.-or-
rects’ is null.
DrawString(струја, Font, Brush, Float, Float)
Нацртајте одређену текстуалну линију на одређеном месту са наведеним објектима Aspose.Imaging.Brush и Wl17.Font.
public void DrawString(string s, Font font, Brush brush, float x, float y)
Parameters
s
string
Трчање за цртање.
font
Font
Aspose.Imaging.Фонт који дефинише текстуални формат редове.
brush
Brush
Aspose.Imaging.Бруш који одређује боју и текстуру цртаног текста.
x
float
Кс-координат у горњем левом углу извученог текста.
y
float
И-координат у горњем левом углу извученог текста.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(струја, шрифт, брисх, тачка)
Нацртајте одређену текстуалну линију на одређеном месту са наведеним објектима Aspose.Imaging.Brush и Wl17.Font.
public void DrawString(string s, Font font, Brush brush, PointF point)
Parameters
s
string
Трчање за цртање.
font
Font
Aspose.Imaging.Фонт који дефинише текстуални формат редове.
brush
Brush
Aspose.Imaging.Бруш који одређује боју и текстуру цртаног текста.
point
PointF
Aspose.Imaging.PointF структура која одређује горњи леви угао цртаног текста.
Examples
Да би се показала операција, пример ствара нову слику у ПНГ формату и црта примитивне облике на површини слике користећи методе Цртања изложене графичким класом.
//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(string, Font, Brush, float, float, StringFormat)
Нацртајте одређену текстуалну нијансу на одређеном месту са означеним Aspose.Imaging.Бруш и _ВЛ17.Фонт објектима користећи атрибуте форматирања наведеног УЛ 17 .СтрингФормат.
public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format)
Parameters
s
string
Трчање за цртање.
font
Font
Aspose.Imaging.Фонт који дефинише текстуални формат редове.
brush
Brush
Aspose.Imaging.Бруш који одређује боју и текстуру цртаног текста.
x
float
Кс-координат у горњем левом углу извученог текста.
y
float
И-координат у горњем левом углу извученог текста.
format
StringFormat
Aspose.Imaging.StringФормат који одређује атрибуте форматирања, као што су распоређивање линија и усаглашавање, који се примењују на цртани текст.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(String, Font, Brush, PointF, StringFormat)
Нацртајте одређену текстуалну нијансу на одређеном месту са означеним Aspose.Imaging.Бруш и _ВЛ17.Фонт објектима користећи атрибуте форматирања наведеног УЛ 17 .СтрингФормат.
public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)
Parameters
s
string
Трчање за цртање.
font
Font
Aspose.Imaging.Фонт који дефинише текстуални формат редове.
brush
Brush
Aspose.Imaging.Бруш који одређује боју и текстуру цртаног текста.
point
PointF
Aspose.Imaging.PointF структура која одређује горњи леви угао цртаног текста.
format
StringFormat
Aspose.Imaging.StringФормат који одређује атрибуте форматирања, као што су распоређивање линија и усаглашавање, који се примењују на цртани текст.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(струја, шрифт, бриш, РектанглеФ)
Нацртајте одређену текстуалну линију у одређеном правоугаону са наведеним објектима Aspose.Imaging.Бруш и _ВЛ17.Фонт.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)
Parameters
s
string
Трчање за цртање.
font
Font
Aspose.Imaging.Фонт који дефинише текстуални формат редове.
brush
Brush
Aspose.Imaging.Бруш који одређује боју и текстуру цртаног текста.
layoutRectangle
RectangleF
Aspose.Imaging.RectangleF структура која одређује локацију цртаног текста.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(string, Font, Brush, RectangleF, StringFormat)
Нацртајте одређену текстуалну линију у одређеном правоугаону са специфичним Aspose.Imaging.Бруш и _ВЛ17.Фонт објектима користећи атрибуте форматирања специфичног УЛ 17 .СтрингФормат.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
Parameters
s
string
Трчање за цртање.
font
Font
Aspose.Imaging.Фонт који дефинише текстуални формат редове.
brush
Brush
Aspose.Imaging.Бруш који одређује боју и текстуру цртаног текста.
layoutRectangle
RectangleF
Aspose.Imaging.RectangleF структура која одређује локацију цртаног текста.
format
StringFormat
Aspose.Imaging.StringФормат који одређује атрибуте форматирања, као што су распоређивање линија и усаглашавање, који се примењују на цртани текст.
Exceptions
brush’ is null.-or-
s’ is null.-or-
brush’ is null.
EndUpdate()
Заврши се кеширање графичких операција које су започеле након што је позвано BeginUpdate. Претходне графичке операције ће се применити одмах када се позове овај метод.
public void EndUpdate()
FillClosedCurve(Бруш, ПоинтФ[])
Напуњава унутрашњост затворене кардиналне сплине кривине дефинисане низ структура Aspose.Imaging.PointF. Овај метод користи подразумевани напон од 0.5 и _ВЛ17.FillMode.Alternate режим попуњавања.
public void FillClosedCurve(Brush brush, PointF[] points)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Бруш, ПоинтФ[], Филммоде)
Попуњава унутрашњост затворене кардиналне сплине кривине дефинисане низ Aspose.Imaging.PointF структура користећи одређени режим попуњавања. Овај метод користи подразумевани напон од 0.5.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
fillMode
FillMode
Члан листе Aspose.Imaging.FillMode који одређује како је кривина испуњена.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Бруш, ПоинтФ[], FillMode , Флоат)
Напуњава унутрашњост затворене кардиналне кривине која је дефинисана низ структура Aspose.Imaging.PointF користећи одређени режим пуњења и напетост.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које дефинишу сплине.
fillmode
FillMode
Члан листе Aspose.Imaging.FillMode који одређује како је кривина испуњена.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Бруш, тачка[])
Напуњава унутрашњост затворене кардиналне сплине кривине дефинисане низ структура Aspose.Imaging.Поинт. Овај метод користи подразумевани напон од 0.5 и _ВЛ17.FillMode.Alternate режим попуњавања.
public void FillClosedCurve(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Бруш, тачка[], Филммоде)
Попуњава унутрашњост затворене кардиналне сплине кривине дефинисане низ Aspose.Imaging.Поинт структуре користећи одређени режим попуњавања.Овај метод користи подразумевани напон од 0.5.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
fillmode
FillMode
Члан листе Aspose.Imaging.FillMode који одређује како је кривина испуњена.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Бруш, тачка[], FillMode , Флоат)
Напуњава унутрашњост затворене кардиналне сплине кривине дефинисане низ Aspose.Imaging.Поинт структура користећи одређени режим пуњења и напетост.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које дефинишу сплине.
fillmode
FillMode
Члан листе Aspose.Imaging.FillMode који одређује како је кривина испуњена.
tension
float
Вредност већа од или једнака 0.0Ф која указује на напетост кривине.
Exceptions
brush’ is null.-or-
points’ is null.
FillEllipse(Бруш, Ректанглеф)
Попуњава унутрашњост елипсе која је дефинисана граничним правоугаоном одређеном структуром Aspose.Imaging.RectangleF.
public void FillEllipse(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
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.Бруш који одређује карактеристике пуњења.
x
float
Кс-координат у горњем левом углу граничног правоугаоника који дефинише елипсу.
y
float
И-координат врхунско-левог угла граничног правоугаоника који дефинише елипсу.
width
float
Ширина граничног правоугаоника који дефинише елипсу.
height
float
Висина граничног правоугаоника који дефинише елипсу.
Exceptions
brush’ is null.
FillEllipse(Бруш, ректонгл)
Попуњава унутрашњост елипсе дефинисане граничним правоугаоном одређеном структуром Aspose.Imaging.Rectangle.
public void FillEllipse(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
rect
Rectangle
WL17_.Ректанг структура која представља гранични правоугао који дефинише елипсу.
Exceptions
brush’ is null.
FillEllipse(Бруш, инт, инт, инт, инт)
Попуњава унутрашњост елипсе која је дефинисана граничним правоугаоном одређеним паром координати, ширином и висином.
public void FillEllipse(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
x
int
Кс-координат у горњем левом углу граничног правоугаоника који дефинише елипсу.
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.Бруш који одређује карактеристике пуњења.
path
GraphicsPath
Aspose.Imaging.GrafikaPath koji predstavlja put za ispunjavanje.
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.Бруш који одређује карактеристике пуњења.
rect
Rectangle
WL17_.Ректанг структура која представља гранични правоугао који дефинише елипсу из којег долази пеј секција.
startAngle
float
Угао у степенима мери се са часовима од х-аксиса до прве стране пеј секције.
sweepAngle
float
Угао у степенима се мери са часовима од параметара startAngle’ на другу страну секције пе.
Examples
Следећи пример показује како да се компонује анимирана ГИФ слика из појединачних ГиФ блокова.
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(Бруш, РектанглеФ, плутање, плутање)
Попуњава унутрашњост пеј секције дефинисане елипсом одређеном структуром Aspose.Imaging.RectangleF и две радиалне линије.
public void FillPie(Brush brush, RectangleF rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
rect
RectangleF
Aspose.Imaging.RectangleF структура која представља гранични правоугао који дефинише елипсу из којег долази пеј секција.
startAngle
float
Угао у степенима мери се са часовима од х-аксиса до прве стране пеј секције.
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.Бруш који одређује карактеристике пуњења.
x
float
Кс-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази пеј секција.
y
float
И-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази пеј секција.
width
float
Ширина граничног правоугаоника који дефинише елипсу из којег долази пеј секција.
height
float
Висина граничног правоугаоника који дефинише елипсу из којег долази пеј секција.
startAngle
float
Угао у степенима мери се са часовима од х-аксиса до прве стране пеј секције.
sweepAngle
float
Угао у степенима се мери са часовима од параметара startAngle’ на другу страну секције пе.
Exceptions
brush’ is null.
FillPie(Brush, int, int, 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.Бруш који одређује карактеристике пуњења.
x
int
Кс-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази пеј секција.
y
int
И-координат врхунско-левог угла граничног правоугао који дефинише елипсу из којег долази пеј секција.
width
int
Ширина граничног правоугаоника који дефинише елипсу из којег долази пеј секција.
height
int
Висина граничног правоугаоника који дефинише елипсу из којег долази пеј секција.
startAngle
int
Угао у степенима мери се са часовима од х-аксиса до прве стране пеј секције.
sweepAngle
int
Угао у степенима се мери са часовима од параметара startAngle’ на другу страну секције пе.
Exceptions
brush’ is null.
FillPolygon(Бруш, ПоинтФ[])
Попуњава унутрашњост полигона дефинисаног низ тачака одређених структурама Aspose.Imaging.PointF и Wl17.FillMode.Alternate.
public void FillPolygon(Brush brush, PointF[] points)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које представљају вертикале полигона за попуњавање.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Бруш, ПоинтФ[], Филммоде)
Попуњава унутрашњост полигона дефинисаног низ тачака одређених структурама Aspose.Imaging.PointF користећи одређени режим попуњавања.
public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
PointF
[]
Поремећај Aspose.Imaging.PointF структура које представљају вертикале полигона за попуњавање.
fillMode
FillMode
Član Aspose.Imaging.FillMode popisa koji određuje stil punjenja.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Бруш, тачка[])
Попуњава унутрашњост полигона дефинисаног низ тачака одређених Aspose.Imaging.Поинт структуре и _ВЛ17.FillMode.Alternate.
public void FillPolygon(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које представљају вертикале полигона за попуњавање.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Бруш, тачка[], Филммоде)
Попуњава унутрашњост полигона дефинисаног низ тачака одређених Aspose.Imaging.Точка структура користећи одређени режим попуњавања.
public void FillPolygon(Brush brush, Point[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
points
Point
[]
Поремећај Aspose.Imaging.Поинт структуре које представљају вертикале полигона за попуњавање.
fillMode
FillMode
Član Aspose.Imaging.FillMode popisa koji određuje stil punjenja.
Exceptions
brush’ is null.-or-
points’ is null.
FillRectangle(Бруш, ректонгл)
Попуњава унутрашњост правоугао одређеног структуром Aspose.Imaging.Rectangle.
public void FillRectangle(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
rect
Rectangle
Aspose.Imaging.Ректанг структура која представља правоугао за попуњавање.
Exceptions
brush’ is null.
FillRectangle(Бруш, Ректанглеф)
Попуњава унутрашњост правоугао који је одређен структуром Aspose.Imaging.RectangleF.
public void FillRectangle(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
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.Бруш који одређује карактеристике пуњења.
x
float
Кс-координат у горњем левом углу правоугаоника да попуни.
y
float
И-координат врхунско-левог угла правоугаоца да испуни.
width
float
Ширина правоугаоника да попуни.
height
float
Висина правоугаоника да се испуни.
Exceptions
brush’ is null.
FillRectangle(Бруш, инт, инт, инт, инт)
Попуњава унутрашњост правоугао који је одређен паром координати, ширином и висином.
public void FillRectangle(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
x
int
Кс-координат у горњем левом углу правоугаоника да попуни.
y
int
И-координат врхунско-левог угла правоугаоца да испуни.
width
int
Ширина правоугаоника да попуни.
height
int
Висина правоугаоника да се испуни.
Exceptions
brush’ is null.
FillRectangles(Бруш, ректонгл[])
Попуњава унутрашњости серије правоугаоних структура које одређује Aspose.Imaging.
public void FillRectangles(Brush brush, Rectangle[] rects)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
rects
Rectangle
[]
Поремећај Aspose.Imaging.Ректунгл структуре које представљају правоугао за попуњавање.
Exceptions
brush’ is null or
rects’ is null.
FillRectangles(Бруш, Ректанглеф[])
Попуњава унутрашњости серије правоугаоника одређених Aspose.Imaging.RectangleF структурама.
public void FillRectangles(Brush brush, RectangleF[] rects)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
rects
RectangleF
[]
Поремећај Aspose.Imaging.Ректунгл структуре које представљају правоугао за попуњавање.
Exceptions
brush’ is null or
rects’ is null.
FillRegion(Бруш, Регион)
Попуњава унутрашњост Aspose.Imaging.Регион.
public void FillRegion(Brush brush, Region region)
Parameters
brush
Brush
Aspose.Imaging.Бруш који одређује карактеристике пуњења.
region
Region
Aspose.Imaging.Регион који представља подручје за попуњавање.
Exceptions
brush’ is null.-or-
region’ is null.
~Graphics()
protected ~Graphics()
MeasureString(string, font, SizeF, StringFormat)
Мерење одређене текстуалне нијансе са специфичним параметрима
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameters
text
string
Tekst je trebao da se meri.
font
Font
Писмо за мерење.
layoutArea
SizeF
Област распореда.
stringFormat
StringFormat
Формат за струју.
Returns
Величина у пикселима измереног текстуалног струка
MultiplyTransform(Matrix)
Умножава ВЛ17.Матрик који представља локалну геометријску трансформацију овог _WL17.Графике од стране одређеног __УН17 _.Матрик препендирајући одређену _ИН 17 .Метрик.
public void MultiplyTransform(Matrix matrix)
Parameters
matrix
Matrix
Aspose.Imaging.Матрикс којим да умножи геометријску трансформацију.
MultiplyTransform(Матрицс, Матрицсордер)
Умножава ВЛ17.Матрикс који представља локалну геометријску трансформацију овог _WL17.Графике од стране одређеног _УЛ 17 .Матрикс у наведеном реду.
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
Aspose.Imaging.Матрикс којим да умножи геометријску трансформацију.
order
MatrixOrder
Aspose.Imaging.MatrixOrder који одређује у којем сврху да умножи две матрице.
ResetTransform()
Преузмите Aspose.Imaging.Графике.Претварање имовине у идентитет.
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
Количина у којој се скалира трансформација у правцу х-аксиса.
sy
float
Количина у којој се скалира трансформација у правцу и-аксиса.
ScaleTransform(плутање, плутање, MatrixOrder)
Скелирајте локалну геометријску трансформацију одређеним количинама у одређеном реду.
public void ScaleTransform(float sx, float sy, MatrixOrder order)
Parameters
sx
float
Количина у којој се скалира трансформација у правцу х-аксиса.
sy
float
Количина у којој се скалира трансформација у правцу и-аксиса.
order
MatrixOrder
Aspose.Imaging.MatrixOrder који одређује да ли треба додати или пребацити матрицу за скалирање.
TranslateTransform(пловила, пловила)
Преводи локалну геометријску трансформацију одређеним димензијама. Овај метод превезује превод на трансформацију.
public void TranslateTransform(float dx, float dy)
Parameters
dx
float
Vrednost prevoda u x.
dy
float
Вредност превођења у и.
TranslateTransform(плутање, плутање, MatrixOrder)
Преводи локалну геометријску трансформацију одређеним димензијама у одређеном реду.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
Vrednost prevoda u x.
dy
float
Вредност превођења у и.
order
MatrixOrder
Наредба (препенд или апенд) у којој се примењује превод.