Class Graphics
Названий на: Aspose.Imaging Асамблея: Aspose.Imaging.dll (25.4.0)
Представляє графіки відповідно до графічного двигуна, що використовується в поточній скупченні.
public sealed class Graphics
Inheritance
Нападні члени
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Constructors
Graphics(Image)
Ініціалює новий приклад класу Aspose.Imaging.Графіки.
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.Graphics.
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.Graphics.
public Matrix Transform { get; set; }
вартість нерухомості
Methods
BeginUpdate()
Графічні ефекти, що застосовуються пізніше, не будуть застосовуватися відразу, а EndUpdate призведе до застосування всіх ефектів одночасно.
public void BeginUpdate()
Remarks
Зауважимо, що ефекти після того, як зателефонується BeginUpdate не буде застосовано, якщо EndUpdate не зателефонується.
Clear(Color)
Очищає графічну поверхню за допомогою зазначеного кольору.
public void Clear(Color color)
Parameters
color
Color
Колір для очищення графічної поверхні.
Examples
Ці приклади використовують клас GraphicsPath і Графіки, щоб створити і маніпулювати Фігурами на зображенні поверхні. Приклад створює нову Зображення (типу Tiff), очищає поверхню і витягує шляхи за допомогою класу Grafics Path.
//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
//Create an instance of TiffOptions and set its various properties
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
//Set the source for the instance of ImageOptions
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();
//Create an instance of Figure class
Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);
// save all changes.
image.Save();
}
}
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
DrawArc(Флоту, флоту, флоту, флоту, флоту, флоту)
Розтягує арку, що представляє частину еліпсу, визначену парами координатів, шириною і висотою.
public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль арку.
x
float
X-координат верхньо-лівого кута прямокутника, що визначає еліпс.
y
float
Y-координат верхньо-лівого кута прямокутника, що визначає еліпс.
width
float
Ширина прямокутника, що визначає еліпс.
height
float
Висота прямокутника, що визначає еліпс.
startAngle
float
Уголь у ступенях вимірюється годинником від х-акси до початкової точки арку.
sweepAngle
float
Уголь у ступенях вимірюється годинником з параметра startAngle’ до кінця точки арку.
Exceptions
pen’ is null.
DrawArc(Пінгвіни, Пінгвіни, Пінгвіни, Пінгвіни)
Витягує арку, що являє собою частину еліпсу, зазначену структурою Aspose.Imaging.RectangleF.
public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль арку.
rect
RectangleF
Aspose.Imaging.RectangleF структура, яка визначає межі еліпсу.
startAngle
float
Уголь у ступенях вимірюється годинником від х-акси до початкової точки арку.
sweepAngle
float
Уголь у ступенях вимірюється годинником з параметра startAngle’ до кінця точки арку.
Exceptions
pen’ is null
DrawArc(Пін, int, int, int, int, int, int)
Розтягує арку, що представляє частину еліпсу, визначену парами координатів, шириною і висотою.
public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль арку.
x
int
X-координат верхньо-лівого кута прямокутника, що визначає еліпс.
y
int
Y-координат верхньо-лівого кута прямокутника, що визначає еліпс.
width
int
Ширина прямокутника, що визначає еліпс.
height
int
Висота прямокутника, що визначає еліпс.
startAngle
int
Уголь у ступенях вимірюється годинником від х-акси до початкової точки арку.
sweepAngle
int
Уголь у ступенях вимірюється годинником з параметра startAngle’ до кінця точки арку.
Exceptions
pen’ is null.
DrawArc(Пінгвіни, Пінгвіни, Пінгвіни)
Витягує арку, що являє собою частину еліпсу, зазначену структурою Aspose.Imaging.Rectangle.
public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль арку.
rect
Rectangle
Aspose.Imaging.RectangleF структура, яка визначає межі еліпсу.
startAngle
float
Уголь у ступенях вимірюється годинником від х-акси до початкової точки арку.
sweepAngle
float
Уголь у ступенях вимірюється годинником з параметра startAngle’ до кінця точки арку.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawBezier(Пін, флот, флот, флот, флот, флот, флот, флот, флот)
Витягує бізьку смугу, яка визначається чотирма розпорядженими парами координатів, які представляють точки.
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
X-координат початкової точки криви.
y1
float
Y-координат початкової точки криви.
x2
float
X-координат першої контрольної точки криви.
y2
float
Y-координат першої контрольної точки криви.
x3
float
X-координат другої контрольної точки криви.
y3
float
Y-координат другої контрольної точки криви.
x4
float
X-координат кінцевої точки криви.
y4
float
Y-координат кінцевої точки криви.
Exceptions
pen’ is null.
DrawBezier(Пін, PointF, PointF, PointF і PointF)
Розташовується сплит Bézier, який визначається чотирма структурами 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(Пін, точка, точка, точка)
Розташовується сплит Bézier, який визначається чотирма Aspose.Imaging.Point структурами.
public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
Parameters
pen
Pen
Структура пен, яка визначає колір, ширину і стиль криви.
pt1
Point
Aspose.Imaging.Точкова структура, яка являє собою початкову точку криви.
pt2
Point
Aspose.Imaging.Точкова структура, яка являє собою першу контрольну точку для криви.
pt3
Point
Aspose.Imaging.Точкова структура, яка являє собою другу контрольну точку для криви.
pt4
Point
Aspose.Imaging.Точкова структура, що являє собою кінцеву точку криви.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawBeziers(Пін, точка[])
Витягує серію Bézier splines з ряду Aspose.Imaging.Point структур.
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[])
Витягує серію спливів Bézier з ряду структур 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 за допомогою визначеного напруги.Цей метод використовує стандартний режим заповнення Wl17.FillMode.Alternate.
public void DrawClosedCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і висоту криви.
points
PointF
[ ]
Серія Aspose.Imaging.PointF структур, які визначають сплину.
tension
float
Вартість більша або дорівнює 0,0F, що визначає напругу криви.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Пін, точка[])
Витягує закриту кардинальну смугу, визначену низкою Aspose.Imaging.Point структур. Цей метод використовує за замовчуванням напругу 0,5 і W L17.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.Point структур за допомогою визначеного напруги.Цей метод використовує стандартний режим заповнення __ WL16__ .FillMode.Alternate.
public void DrawClosedCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і висоту криви.
points
Point
[ ]
Серія Aspose.Imaging.Точкових структур, які визначають сплину.
tension
float
Вартість більша або дорівнює 0,0F, що визначає напругу криви.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Пінгвіна, PointF[])
Витягує кардинальну смугу через визначений ряд структур Aspose.Imaging.PointF. Цей метод використовує стандартне напруження 0,5.
public void DrawCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і висоту криви.
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,0F, що визначає напругу криви.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Пінгвіна, PointF[ ], ІТ, ІТ)
Витягує кардинальну спліну через визначену смугу структур 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,0F, що визначає напругу криви.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Пін, точка[])
Витягує кардинальну смугу через визначену серію Aspose.Imaging.Point структур.
public void DrawCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і висоту криви.
points
Point
[ ]
Серія Aspose.Imaging.Точкових структур, які визначають сплину.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Пін, точка[ ], Флотація)
Витягує кардинальну смугу через визначений ряд Aspose.Imaging.Point структур за допомогою визначеного напруги.
public void DrawCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і висоту криви.
points
Point
[ ]
Серія Aspose.Imaging.Точкових структур, які визначають сплину.
tension
float
Вартість більша або дорівнює 0,0F, що визначає напругу криви.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Пін, точка[ ], int , int , float)
Витягує кардинальну смугу через визначений ряд Aspose.Imaging.Point структур за допомогою визначеного напруги.
public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і висоту криви.
points
Point
[ ]
Серія Aspose.Imaging.Точкових структур, які визначають сплину.
offset
int
Відстань від першого елемента в порядку points’ параметра до початкової точки в криві.
numberOfSegments
int
Кількість сегментів після початкової точки включити в криву.
tension
float
Вартість більша або дорівнює 0,0F, що визначає напругу криви.
Exceptions
pen’ is null.-or-
points’ is null.
DrawEllipse(Пін, Ректангліф)
Витягує еліпсу, визначену обмеженою Aspose.Imaging.RectangleF.
public void DrawEllipse(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль еліпсу.
rect
RectangleF
Aspose.Imaging.RectangleF структура, яка визначає межі еліпсу.
Exceptions
pen’ is null.
DrawEllipse(Пін, флот, флот, флот, флот)
Витягує еліпс, який визначається обмеженим прямокутником, визначеним парами координатів, висотою і шириною.
public void DrawEllipse(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль еліпсу.
x
float
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
y
float
Y-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
width
float
Ширина лінійного прямокутника, що визначає еліпс.
height
float
Висота лінійного прямокутника, що визначає еліпс.
Exceptions
pen’ is null.
DrawEllipse(Пін, прямокутний)
Витягує еліпсу, визначену обмеженою структурою Aspose.Imaging.Rectangle.
public void DrawEllipse(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль еліпсу.
rect
Rectangle
Aspose.Imaging.Ректоугольна структура, яка визначає межі еліпсу.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawEllipse(Пін, int, int, int, int)
Витягує еліпс, який визначається обмеженим прямокутником, визначеним парами координатів, висотою і шириною.
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль еліпсу.
x
int
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
y
int
Y-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
width
int
Ширина лінійного прямокутника, що визначає еліпс.
height
int
Висота лінійного прямокутника, що визначає еліпс.
Exceptions
pen’ is null.
DrawImage(Створення PointF)
Знайдіть зазначений Aspose.Imaging.Graphics.Image, використовуючи його оригінальний фізичний розмір, на зазначеному місці.
public void DrawImage(Image sourceImage, PointF point)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
point
PointF
Aspose.Imaging.PointF структура, що представляє верхній лівий кут зображення.
Exceptions
sourceImage’ is null.
DrawImage(Створення Float, Float)
Знайдіть зазначений Aspose.Imaging.Graphics.Image, використовуючи його оригінальний фізичний розмір, на зазначеному місці.
public void DrawImage(Image sourceImage, float x, float y)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
x
float
X-координат верхнього лівого кута зображення.
y
float
Y-координат верхньо-лівого кута зображення.
Exceptions
sourceImage’ is null.
DrawImage(Створення RectangleF)
Знайдіть визначену Aspose.Imaging.Graphics.Image на визначеному місці та з зазначеною розміром.
public void DrawImage(Image sourceImage, RectangleF rect)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
rect
RectangleF
Aspose.Imaging.RectangleF структура, яка визначає місце розташування і розмір зображення.
Exceptions
sourceImage’ is null.
DrawImage(Зображення, прямокутник, графіки)
Знайдіть визначену 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(Створення Image, Rectangle, GraphicsUnit)
Знайдіть визначену Aspose.Imaging.Graphics.Image на визначеному місці та з зазначеною розміром.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
rectDestination
Rectangle
Мета призначення прямокутника.
graphicsUnit
GraphicsUnit
Графічна одиниця .
imageAttributes
ImageAttributes
Зображення має атрибути.
Exceptions
sourceImage’ is null.
DrawImage(Зображення, RectangleF, GraphicsUnit, ImageAttributes)
Знайдіть визначену Aspose.Imaging.Graphics.Image на визначеному місці та з зазначеною розміром.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
rectDestination
RectangleF
Мета прямокутника для витягу.
graphicsUnit
GraphicsUnit
Графічна одиниця .
imageAttributes
ImageAttributes
Зображення має атрибути.
Exceptions
sourceImage’ is null.
DrawImage(Створення Rectangle, Rectangle, Graphics)
Знайдіть визначену 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, 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(Зображення, точка[])
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, Point[] destPoints)
Parameters
image
Image
Зображення для зображення.
destPoints
Point
[ ]
Серія трьох структур PointF, які визначають паралелограм.
DrawImage(Зображення, точка[ ], Ректанглі)
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)
Parameters
image
Image
Зображення для зображення.
destPoints
Point
[ ]
Серія трьох структур PointF, які визначають паралелограм.
srcRect
Rectangle
Джерело прямокутника .
DrawImage(Зображення, точка[ ], Ректанглі, Графіки)
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Зображення для зображення.
destPoints
Point
[ ]
Серія трьох структур PointF, які визначають паралелограм.
srcRect
Rectangle
Джерело прямокутника .
srcUnit
GraphicsUnit
Одиниці вимірювання.
DrawImage(Зображення, точка[ ], Rectangle, GraphicsUnit, ImageAttributes)
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Зображення для зображення.
destPoints
Point
[ ]
Серія трьох структур PointF, які визначають паралелограм.
srcRect
Rectangle
Джерело прямокутника .
srcUnit
GraphicsUnit
Одиниці вимірювання.
imageAttributes
ImageAttributes
Зображення має атрибути.
DrawImage(Створення PointF[])
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
Зображення для зображення.
destPoints
PointF
[ ]
Серія трьох структур PointF, які визначають паралелограм.
Exceptions
Зображення
DrawImage(Створення PointF[ ], Ректангліф)
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
Зображення для зображення.
destPoints
PointF
[ ]
Серія трьох структур PointF, які визначають паралелограм.
srcRect
RectangleF
Джерело прямокутника .
DrawImage(Створення PointF[ ], RectangleF, GraphicsUnit)
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Зображення для зображення.
destPoints
PointF
[ ]
Серія трьох структур PointF, які визначають паралелограм.
srcRect
RectangleF
Джерело прямокутника .
srcUnit
GraphicsUnit
Одиниці вимірювання.
DrawImage(Створення PointF[ ], RectangleF, GraphicsUnit, ImageAttributes)
Натисніть зазначену частину зазначеного image’ на зазначеному місці та з зазначеним розміром.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Зображення для зображення.
destPoints
PointF
[ ]
Серія трьох структур PointF, які визначають паралелограм.
srcRect
RectangleF
Джерело прямокутника .
srcUnit
GraphicsUnit
Одиниці вимірювання.
imageAttributes
ImageAttributes
Зображення має атрибути.
DrawImage(Флоту, Флоту, Флоту, Флоту)
Знайдіть визначену Aspose.Imaging.Graphics.Image на визначеному місці та з зазначеною розміром.
public void DrawImage(Image sourceImage, float x, float y, float width, float height)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
x
float
X-координат верхнього лівого кута зображення.
y
float
Y-координат верхньо-лівого кута зображення.
width
float
Ширина витягнутого зображення.
height
float
Висота витягнутого зображення.
Exceptions
sourceImage’ is null.
DrawImage(Зображення, точка)
Знайдіть зазначений Aspose.Imaging.Graphics.Image, використовуючи його оригінальний фізичний розмір, на зазначеному місці.
public void DrawImage(Image sourceImage, Point point)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
point
Point
Aspose.Imaging.Точкова структура, що представляє місце розташування верхньо-лівого кута зображення.
Exceptions
sourceImage’ is null.
DrawImage(Зображення, int, int)
Знайдіть зазначений зображення, використовуючи його оригінальний фізичний розмір, на місці, зазначеному координатною пару.
public void DrawImage(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
x
int
X-координат верхнього лівого кута зображення.
y
int
Y-координат верхньо-лівого кута зображення.
Exceptions
sourceImage’ is null.
DrawImage(Створення Rectangle)
Знайдіть визначену Aspose.Imaging.Graphics.Image на визначеному місці та з зазначеною розміром.
public void DrawImage(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
rect
Rectangle
Aspose.Imaging.Структура прямокутника, яка визначає місце розташування і розмір зображення.
Exceptions
sourceImage’ is null.
DrawImage(Зображення, int, int, int, int)
Знайдіть визначену Aspose.Imaging.Graphics.Image на визначеному місці та з зазначеною розміром.
public void DrawImage(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
x
int
X-координат верхнього лівого кута зображення.
y
int
Y-координат верхньо-лівого кута зображення.
width
int
Ширина витягнутого зображення.
height
int
Висота витягнутого зображення.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Зображення, точка)
Знайдіть конкретний зображення за допомогою його оригінального фізичного розміру в конкретному місці.
public void DrawImageUnscaled(Image sourceImage, Point point)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
point
Point
Aspose.Imaging.Точкова структура, яка визначає верхній лівий кут зображення.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Зображення, int, int)
Використовуйте оригінальний фізичний розмір зображення на місці, визначеному парами координатів.
public void DrawImageUnscaled(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
x
int
X-координат верхнього лівого кута зображення.
y
int
Y-координат верхньо-лівого кута зображення.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Створення Rectangle)
Знайдіть конкретний зображення за допомогою його оригінального фізичного розміру в конкретному місці.
public void DrawImageUnscaled(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
rect
Rectangle
Aspose.Imaging.Rectangle, що визначає верхній лівий кут витягнутого зображення. X і Y властивості прямого кута визначають верхньо-лівий рог.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Зображення, int, int, int, int)
Знайдіть конкретний зображення за допомогою його оригінального фізичного розміру в конкретному місці.
public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
x
int
X-координат верхнього лівого кута зображення.
y
int
Y-координат верхньо-лівого кута зображення.
width
int
Параметр не використовується.
height
int
Параметр не використовується.
Exceptions
sourceImage’ is null.
DrawImageUnscaledAndClipped(Створення Rectangle)
Витягніть зазначений зображення без скалювання і, якщо це необхідно, витягніть його, щоб відповідати зазначеному прямокутню.
public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Зображення, з яким можна витягнути.
rect
Rectangle
Aspose.Imaging.Rectangle, в якому можна малювати зображення.
Exceptions
sourceImage’ is null.
DrawLine(Пін, точка і точка)
Витягує лінію, що з’єднує дві Aspose.Imaging.Point структури.
public void DrawLine(Pen pen, Point point1, Point point2)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль лінії.
point1
Point
Aspose.Imaging.Точкова структура, яка являє собою першу точку для підключення.
point2
Point
Aspose.Imaging.Точкова структура, яка являє собою другий пункт для підключення.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawLine(Пін, PointF і PointF)
Витягує лінію, що з’єднує дві структури Aspose.Imaging.PointF.
public void DrawLine(Pen pen, PointF point1, PointF point2)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль лінії.
point1
PointF
Aspose.Imaging.PointF структура, яка являє собою першу точку для підключення.
point2
PointF
Aspose.Imaging.PointF структура, яка являє собою другий пункт для підключення.
Exceptions
pen’ is null.
DrawLine(Пін, int, int, int, int)
Витягує лінію, що з’єднує дві точки, визначені координатними парами.
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль лінії.
x1
int
Координат X першого пункту.
y1
int
Координація першого пункту.
x2
int
Координат X з другої точки.
y2
int
Координати другого пункту.
Exceptions
pen’ is null.
DrawLine(Пін, флот, флот, флот, флот)
Витягує лінію, що з’єднує дві точки, визначені координатними парами.
public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль лінії.
x1
float
Координат X першого пункту.
y1
float
Координація першого пункту.
x2
float
Координат X з другої точки.
y2
float
Координати другого пункту.
Exceptions
pen’ is null.
DrawLines(Пін, точка[])
Розташовує серію лінійних сегментів, які з’єднують ряд Aspose.Imaging.Point структур.
public void DrawLines(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль сегментів лінії.
points
Point
[ ]
Серія Aspose.Imaging.Точкових структур, які представляють точки для підключення.
Exceptions
pen’ is null.-or-
points’ is null.
Розділ пунктів " містить менше 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.
Розділ пунктів " містить менше 2 пунктів.
DrawPath(Пін, GraphicsPath)
Завантажити Aspose.Imaging.GraphicsPath.
public void DrawPath(Pen pen, GraphicsPath path)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль шляху.
path
GraphicsPath
Aspose.Imaging.ГрафікиПосібник для зображення.
Examples
Ці приклади використовують клас GraphicsPath і Графіки, щоб створити і маніпулювати Фігурами на зображенні поверхні. Приклад створює нову Зображення (типу Tiff), очищає поверхню і витягує шляхи за допомогою класу Grafics Path.
//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
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс, з якого походить форма пі.
y
float
Y-координат верхньо-лівого кута об’єктивного прямокутника, який визначає еліпс, з якого походить форма пі.
width
float
Ширина лінійного прямокутника, що визначає еліпс, з якого походить п’яна форма.
height
float
Висота лінійного прямокутника, що визначає еліпс, з якого походить форма пі.
startAngle
float
Уголь вимірюється в ступенях годинника від х-акси до першої сторони п’яної форми.
sweepAngle
float
Уголь вимірюється в ступенях годинника від параметра startAngle’ до другої сторони п’яної форми.
Exceptions
pen’ is null.
DrawPie(Пінгвіни, Пінгвіни, Пінгвіни)
Витягує форму пії, визначену еліпсом, зазначеним структурою Aspose.Imaging.Rectangle і двома радиальними лініями.
public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль п’яної форми.
rect
Rectangle
Aspose.Imaging.Ректоугольна структура, яка являє собою обмежувальний прямокутник, який визначає еліпс, з якого походить форма пі.
startAngle
float
Уголь вимірюється в ступенях годинника від х-акси до першої сторони п’яної форми.
sweepAngle
float
Уголь вимірюється в ступенях годинника від параметра startAngle’ до другої сторони п’яної форми.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawPie(Пін, int, int, int, int, int, int)
Витягує форму пі, визначену еліпсом, визначеним координатним парам, шириною, висотою і двома радиальними лініями.
public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль п’яної форми.
x
int
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс, з якого походить форма пі.
y
int
Y-координат верхньо-лівого кута об’єктивного прямокутника, який визначає еліпс, з якого походить форма пі.
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.Point структур.
public void DrawPolygon(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль полігону.
points
Point
[ ]
Розділ Aspose.Imaging.Точкові структури, що представляють вертикали полігону.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawRectangle(Пін, Ректангліф)
Витягує прямокутник, визначений структурою Aspose.Imaging.RectangleF.
public void DrawRectangle(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Pen, що визначає колір, ширину і стиль прямокутника.
rect
RectangleF
Структура Aspose.Imaging.RectangleF, яка являє собою прямокутник для зображення.
Exceptions
pen’ is null.
DrawRectangle(Пін, прямокутний)
Витягує прямокутник, визначений структурою Aspose.Imaging.Rectangle.
public void DrawRectangle(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Pen, що визначає колір, ширину і стиль прямокутника.
rect
Rectangle
Структура Aspose.Imaging.Rectangle, яка являє собою прямокутник для зображення.
Examples
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawRectangle(Пін, флот, флот, флот, флот)
Витягує прямий кут, визначений координатною пару, шириною і висотою.
public void DrawRectangle(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Pen, що визначає колір, ширину і стиль прямокутника.
x
float
X-координат верхньо-лівого кута прямокутника для витягування.
y
float
Y-координат верхньо-лівого кута прямокутника для витягування.
width
float
Ширина прямокутника для витягування.
height
float
Висота прямокутника для витягування.
Exceptions
pen’ is null.
DrawRectangle(Пін, int, int, int, int)
Витягує прямий кут, визначений координатною пару, шириною і висотою.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Пен, який визначає колір, ширину і стиль прямокутника.
x
int
X-координат верхньо-лівого кута прямокутника для витягування.
y
int
Y-координат верхньо-лівого кута прямокутника для витягування.
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(штрих, штрих, штрих, штрих, штрих)
Натисніть зазначену текстову смугу на зазначеному місці за допомогою зазначених об’єктів Aspose.Imaging.Brush і __ WL16__ .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
X-координат верхньо-лівого кута витягнутого тексту.
y
float
Y-координат верхньо-лівого кута витягнутого тексту.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Шрифт, шрифт, шрифт, шрифт)
Натисніть зазначену текстову смугу на зазначеному місці за допомогою зазначених об’єктів Aspose.Imaging.Brush і __ WL16__ .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
Для того, щоб продемонструвати операцію, приклад створює новий зображення у форматі PNG і малює первісні форми на поверхні знімку за допомогою методів малювання, виставлених класом Графіки.
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(шрифт, шрифт, шрифт, шрифт, шрифт, шрифт)
Натисніть зазначену текстову смугу на зазначеному місці за допомогою зазначених об’єктів Aspose.Imaging.Brush і Wl17.Font, використовуючи атрибути форматизації зазначеної смуги __ WL16__ .StringFormat.
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
X-координат верхньо-лівого кута витягнутого тексту.
y
float
Y-координат верхньо-лівого кута витягнутого тексту.
format
StringFormat
Aspose.Imaging.StringFormat, який визначає атрибути форматування, такі як лінійний простір і злиття, які застосовуються до витягнутого тексту.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(шрифт, шрифт, шрифт, шрифт, шрифт)
Натисніть зазначену текстову смугу на зазначеному місці за допомогою зазначених об’єктів Aspose.Imaging.Brush і Wl17.Font, використовуючи атрибути форматизації зазначеної смуги __ WL16__ .StringFormat.
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.StringFormat, який визначає атрибути форматування, такі як лінійний простір і злиття, які застосовуються до витягнутого тексту.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Шрифт, шрифт, шрифт, шрифт)
Натисніть зазначену текстову смугу в зазначеному прямокутці за допомогою зазначених об’єктів Aspose.Imaging.Brush і WR17.Font.
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(шрифт, шрифт, шрифт, шрифт, шрифт)
Натисніть зазначену текстову смугу в зазначеному прямокутці за допомогою зазначених об’єктів Aspose.Imaging.Brush і Wl17.Font, використовуючи атрибути форматизації зазначеної смуги __www.StringFormat.
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.StringFormat, який визначає атрибути форматування, такі як лінійний простір і злиття, які застосовуються до витягнутого тексту.
Exceptions
brush’ is null.-or-
s’ is null.-or-
brush’ is null.
EndUpdate()
Закінчується кашінг графічних операцій, які розпочалися після того, як було зателефоновано BeginUpdate. попередні графічні операції будуть застосовуватися одночасно при зателефонуванні цього методу.
public void EndUpdate()
FillClosedCurve(Брюш, PointF[])
Виповнюється внутрішньою кривою закритого кардиналу, визначеною рядом структур Aspose.Imaging.PointF. Цей метод використовує за замовчуванням напругу 0,5 і __ WL15_.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(Брюш, PointF[ ], Створення Fill)
Заповніть внутрішню криву закритого кардинального спливу, визначену рядом 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(Брюш, PointF[ ], 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,0F, що визначає напругу криви.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Брюш, точка[])
Виповнюється внутрішньою кривою закритого кардиналу, визначеною рядом Aspose.Imaging.Point структур. Цей метод використовує за замовчуванням напругу 0,5 і Wl17.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(Брюш, точка[ ], Створення Fill)
Заповніть внутрішню криву закритого кардинального спливу, визначеного рядом 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.Point структур за допомогою зазначеного режиму заповнення і напруги.
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,0F, що визначає напругу криви.
Exceptions
brush’ is null.-or-
points’ is null.
FillEllipse(Штукатурка, RectangleF)
Виповнюється внутрішньою частиною еліпсу, визначеною обмеженим прямокутником, зазначеним структурою Aspose.Imaging.RectangleF.
public void FillEllipse(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Брушка, яка визначає характеристики наповнення.
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
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
y
float
Y-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
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
Aspose.Imaging.Ректоугольна структура, яка являє собою обмежувальний прямий кут, який визначає еліпс.
Exceptions
brush’ is null.
FillEllipse(Брюш, int, int, int, int)
Вона наповнює внутрішній еліпс, визначений обмеженим прямокутником, визначеним парами координатів, шириною і висотою.
public void FillEllipse(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Брушка, яка визначає характеристики наповнення.
x
int
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
y
int
Y-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс.
width
int
Ширина лінійного прямокутника, що визначає еліпс.
height
int
Висота лінійного прямокутника, що визначає еліпс.
Exceptions
brush’ is null.
FillPath(Створення Brush, GraphicsPath)
Завершує інтер’єр Aspose.Imaging.GraphicsPath.
public void FillPath(Brush brush, GraphicsPath path)
Parameters
brush
Brush
Aspose.Imaging.Брушка, яка визначає характеристики наповнення.
path
GraphicsPath
Aspose.Imaging.GraphicsPath, що являє собою шлях до заповнення.
Exceptions
brush’ is null.-or-
path’ is null.
FillPie(Штукатурка, прямий колір, плавання, плавання)
Вона заповнюється внутрішньою частиною пії, визначеною еліпсом, зазначеним структурою Aspose.Imaging.RectangleF і двома радиальними лініями.
public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Брушка, яка визначає характеристики наповнення.
rect
Rectangle
Aspose.Imaging.Ректоугольна структура, яка являє собою обмежувальний прямий кут, який визначає еліпс, з якого походить пій-секція.
startAngle
float
Уголь у ступенях вимірюється годинником від х-акси до першої сторони пій секції.
sweepAngle
float
Уголь у ступенях вимірюється годинником від параметра startAngle’ до другої сторони розділу пі.
Examples
Наступний приклад показує, як скласти анімаційну GIF-ілюстрацію з окремих блоків.
string dir = "c:\\temp\\";
// Create a GIF image 100 x 100 px.
// The first block is fully black by default.
using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
{
// The first circle is red
Aspose.Imaging.Brushes.SolidBrush brush1 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
// The second circle is black
Aspose.Imaging.Brushes.SolidBrush brush2 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);
// Gradually inscrease the angle of the red arc shape.
for (int angle = 10; angle <= 360; angle += 10)
{
Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
gr.FillPie(brush1, block.Bounds, 0, angle);
gifImage.AddBlock(block);
}
// Gradually inscrease the angle of the black arc and wipe out the red arc.
for (int angle = 10; angle <= 360; angle += 10)
{
Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
gr.FillPie(brush2, block.Bounds, 0, angle);
gr.FillPie(brush1, block.Bounds, angle, 360 - angle);
gifImage.AddBlock(block);
}
gifImage.Save(dir + "animated_radar.gif");
}
Exceptions
brush’ is null.
FillPie(Брюш, РектангльФ, плута, плута)
Вона заповнюється внутрішньою частиною пії, визначеною еліпсом, зазначеним структурою 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
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс, з якого приходить пій-секція.
y
float
Y-координат верхньо-лівого кута об’єктивного прямокутника, який визначає еліпс, з якого приходить пій-секція.
width
float
Ширина лінійного прямокутника, що визначає еліпс, з якого приходить пій-секція.
height
float
Висота лінійного прямокутника, що визначає еліпс, з якого приходить пій-секція.
startAngle
float
Уголь у ступенях вимірюється годинником від х-акси до першої сторони пій секції.
sweepAngle
float
Уголь у ступенях вимірюється годинником від параметра startAngle’ до другої сторони розділу пі.
Exceptions
brush’ is null.
FillPie(Брюш, 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
X-координат верхньо-лівого кута об’єктивного прямокутника, що визначає еліпс, з якого приходить пій-секція.
y
int
Y-координат верхньо-лівого кута об’єктивного прямокутника, який визначає еліпс, з якого приходить пій-секція.
width
int
Ширина лінійного прямокутника, що визначає еліпс, з якого приходить пій-секція.
height
int
Висота лінійного прямокутника, що визначає еліпс, з якого приходить пій-секція.
startAngle
int
Уголь у ступенях вимірюється годинником від х-акси до першої сторони пій секції.
sweepAngle
int
Уголь у ступенях вимірюється годинником від параметра startAngle’ до другої сторони розділу пі.
Exceptions
brush’ is null.
FillPolygon(Брюш, PointF[])
Вона наповнює внутрішню частину полігону, визначену різницею пунктів, зазначених структурами 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(Брюш, PointF[ ], Створення Fill)
Заповніть внутрішню частину полігону, визначену набором пунктів, зазначених структурами Aspose.Imaging.PointF за допомогою зазначеного режиму заповнення.
public void FillPolygon(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.
FillPolygon(Брюш, точка[])
Вона наповнює внутрішню частину полігону, визначену набором пунктів, зазначених Aspose.Imaging.Point структурами і Wl17.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(Брюш, точка[ ], Створення Fill)
Заповніть внутрішню частину полігону, визначену низкою точок, зазначених Aspose.Imaging.Точковими структурами за допомогою зазначеного режиму заповнення.
public void FillPolygon(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.
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(Штукатурка, RectangleF)
Вона заповнюється внутрішнім кутом прямокутника, зазначеного структурою 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
X-координат верхньо-лівого кута прямокутника для заповнення.
y
float
Y-координат верхньо-лівого кута прямокутника для заповнення.
width
float
Швидкість прямокутника для заповнення.
height
float
Висота прямокутника для заповнення.
Exceptions
brush’ is null.
FillRectangle(Брюш, int, int, int, int)
Вона наповнює внутрішній прямокутник, визначений парами координатів, шириною і висотою.
public void FillRectangle(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Брушка, яка визначає характеристики наповнення.
x
int
X-координат верхньо-лівого кута прямокутника для заповнення.
y
int
Y-координат верхньо-лівого кута прямокутника для заповнення.
width
int
Швидкість прямокутника для заповнення.
height
int
Висота прямокутника для заповнення.
Exceptions
brush’ is null.
FillRectangles(Штукатурка, ректорантура[])
Вона наповнює інтер’єри серії прямокутних структур, зазначених Aspose.Imaging.Rectangle.
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(Штукатурка, RectangleF[])
Вона наповнює інтер’єри серії прямих куточків, зазначених 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(Штрих, шрифт, SizeF, StringFormat)
Вимірювання конкретного тексту з конкретними параметрами
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameters
text
string
Текст для вимірювання.
font
Font
Зображення для вимірювання.
layoutArea
SizeF
Місце розташування .
stringFormat
StringFormat
Формат стрічки .
Returns
Розмір у пікселях вимірюваного тексту
MultiplyTransform(Matrix)
Умножується Aspose.Imaging.Matrix, що являє собою місцеву геометричну трансформацію цього Wl17.Графіки за зазначеним _ WL16_ .Matrx заздалегідь визначеного _www.wll.
public void MultiplyTransform(Matrix matrix)
Parameters
matrix
Matrix
Aspose.Imaging.Матрікс, за допомогою якого можна умножити геометричну трансформацію.
MultiplyTransform(Матриця, MatrixOrder)
Умножується Aspose.Imaging.Matrix, що являє собою місцеву геометричну трансформацію цього Wl17.Графіки за зазначеним _ WL16_ .Matrx в зазначенному порядку.
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
Aspose.Imaging.Матрікс, за допомогою якого можна умножити геометричну трансформацію.
order
MatrixOrder
Aspose.Imaging.MatrixOrder, який визначає, в якому напрямку умножити дві матриці.
ResetTransform()
Відновлює Aspose.Imaging.Graphics.Transform property to identity.
public void ResetTransform()
RotateTransform(Флота)
Обертається місцева геометрична трансформація за визначеною кількістю.Цей метод прив’язує обертання до трансформації.
public void RotateTransform(float angle)
Parameters
angle
float
Уголь ротації .
RotateTransform(Створення MatrixOrder)
Ротирає місцеву геометричну трансформацію за зазначеною кількістю в зазначеному порядку.
public void RotateTransform(float angle, MatrixOrder order)
Parameters
angle
float
Уголь ротації .
order
MatrixOrder
Aspose.Imaging.MatrixOrder, який визначає, чи додавати або перекріплювати ротаційну матрицю.
ScaleTransform(Флотація, Флотація)
Розмір локальної геометричної трансформації за зазначеними кількостями.Цей метод прив’язує матрицю скалювання до трансформації.
public void ScaleTransform(float sx, float sy)
Parameters
sx
float
Кількість, за якою розширювати трансформацію в напрямку х-акси.
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
Значення перекладу в x.
dy
float
Значення перекладу в і.
TranslateTransform(плавання, плавання, MatrixOrder)
Перекладає місцеву геометричну трансформацію за визначеними розмірами в визначеному порядку.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
Значення перекладу в x.
dy
float
Значення перекладу в і.
order
MatrixOrder
Замовлення (препенд або додаток), в якому застосовувати переклад.