Class Graphics
Nazwa przestrzeń: Aspose.Imaging Zgromadzenie: Aspose.Imaging.dll (25.4.0)
Przedstawia grafikę według silnika graficznego stosowanego w bieżącym zestawie.
public sealed class Graphics
Inheritance
Dziedziczeni członkowie
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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)
Inicjalizuje nową instancję klasy Aspose.Imaging.Grafika.
public Graphics(Image sourceImage)
Parameters
sourceImage
Image
Zdjęcie źródłowe .
Properties
Clip
Zdobądź lub ustaw region klipu.
public Region Clip { get; set; }
Wartość nieruchomości
CompositingQuality
Uzyskuje lub ustawia jakość kompozycji.
public CompositingQuality CompositingQuality { get; set; }
Wartość nieruchomości
Dpix
Otrzymuje rozdzielczość horyzontalną tego Aspose.Imaging.Grafika.
public float DpiX { get; }
Wartość nieruchomości
Dpiy
Otrzymuje rozdzielczość pionową tego Aspose.Imaging.Grafika.
public float DpiY { get; }
Wartość nieruchomości
Image
Otrzymuje obraz.
public Image Image { get; }
Wartość nieruchomości
InterpolationMode
Dostęp lub ustaw tryb interpolacji.
public InterpolationMode InterpolationMode { get; set; }
Wartość nieruchomości
IsInBeginUpdateCall
Otrzymuje wartość wskazującą, czy grafika znajduje się w stanie połączenia StartUpdate.
public bool IsInBeginUpdateCall { get; }
Wartość nieruchomości
PageScale
Otrzymuje lub ustawia skalowanie między światowymi jednostkami i stronami dla tego Aspose.Imaging.Grafika.
public float PageScale { get; set; }
Wartość nieruchomości
PageUnit
Uzyskać lub ustawić jednostkę pomiaru używany do współrzędnych stron w tym Aspose.Imaging.Grafika.
public GraphicsUnit PageUnit { get; set; }
Wartość nieruchomości
PaintableImageOptions
Otrzymuje lub ustawia opcje obrazu, które są używane do tworzenia malowniczych obrazów próżniowych do rysowania.
public ImageOptionsBase PaintableImageOptions { get; set; }
Wartość nieruchomości
SmoothingMode
Zostaw lub ustaw tryb nawilżania.
public SmoothingMode SmoothingMode { get; set; }
Wartość nieruchomości
TextRenderingHint
Otrzymuje lub ustawia tekst renderujący wskazówkę.
public TextRenderingHint TextRenderingHint { get; set; }
Wartość nieruchomości
Transform
Otrzymuje lub ustawia kopię transformacji geometrycznej świata dla tego Aspose.Imaging.Grafika.
public Matrix Transform { get; set; }
Wartość nieruchomości
Methods
BeginUpdate()
Efekty graficzne zastosowane później nie będą stosowane natychmiast, zamiast EndUpdate spowoduje zastosowanie wszystkich efektów naraz.
public void BeginUpdate()
Remarks
Pamiętaj, że efekty po wezwaniu StartUpdate nie zostaną zastosowane w przypadku, gdy EndUpdate nie zostanie wezwany.
Clear(Color)
Wyczyścić powierzchnię graficzną za pomocą określonego koloru.
public void Clear(Color color)
Parameters
color
Color
Kolor do oczyszczania powierzchni graficznej przez.
Examples
Przykłady te wykorzystują klasę GraphicsPath i grafiki do tworzenia i manipulowania figurami na powierzchni obrazu. Przykład tworzy nową obraz (typu Tiff), oczyszcza powierzchnię i wyciąga ścieżki za pomocą klasy Grafiki.
//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();
}
}
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, float, float, float, float, float)
Drukuje arkę reprezentującą część elipsy określoną przez parę współrzędnych, szerokość i wysokość.
public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl arki.
x
float
X-koordynacja górnego lewego rogu rektanu, który definiuje ellipsa.
y
float
Y-koordynata górnego lewego rogu rektanu, który definiuje ellipsa.
width
float
Szerokość prawicy, która definiuje elips.
height
float
Wysokość rektangłu, który definiuje elips.
startAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do punktu wyjścia arki.
sweepAngle
float
Węgiel w stopniach mierzy się w sposób zegarkowy z parametru startAngle’ do zakończenia punktu arki.
Exceptions
pen’ is null.
DrawArc(Pen, RectangleF, float, float)
Wyciąga arkę reprezentującą część elipsy określoną przez strukturę Aspose.Imaging.RectangleF.
public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl arki.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która definiuje granice elipsy.
startAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do punktu wyjścia arki.
sweepAngle
float
Węgiel w stopniach mierzy się w sposób zegarkowy z parametru startAngle’ do zakończenia punktu arki.
Exceptions
pen’ is null
DrawArc(Pieniądze, int, int, int, int, int, int)
Drukuje arkę reprezentującą część elipsy określoną przez parę współrzędnych, szerokość i wysokość.
public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl arki.
x
int
X-koordynacja górnego lewego rogu rektanu, który definiuje ellipsa.
y
int
Y-koordynata górnego lewego rogu rektanu, który definiuje ellipsa.
width
int
Szerokość prawicy, która definiuje elips.
height
int
Wysokość rektangłu, który definiuje elips.
startAngle
int
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do punktu wyjścia arki.
sweepAngle
int
Węgiel w stopniach mierzy się w sposób zegarkowy z parametru startAngle’ do zakończenia punktu arki.
Exceptions
pen’ is null.
DrawArc(Pen, rektangle, float, float)
Wyciąga arkę reprezentującą część elipsy określoną przez strukturę Aspose.Imaging.Rectangle.
public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl arki.
rect
Rectangle
Aspose.Imaging.RectangleF struktura, która definiuje granice elipsy.
startAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do punktu wyjścia arki.
sweepAngle
float
Węgiel w stopniach mierzy się w sposób zegarkowy z parametru startAngle’ do zakończenia punktu arki.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, float, float, float, float, float, float, float)
Wyciąga linię Bézier określoną przez cztery zamówione pary współrzędnych reprezentujących punkty.
public void DrawBezier(Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kurwy.
x1
float
x-koordynacja punktu wyjścia kurwy.
y1
float
i-koordynacja punktu wyjścia kurwy.
x2
float
x-koordynacja pierwszego punktu sterowania kurwy.
y2
float
Y-koordynacja pierwszego punktu sterowania kurwy.
x3
float
x-koordynacja drugiego punktu sterowania kurwy.
y3
float
Y-koordynacja drugiego punktu sterowania kurwy.
x4
float
X-koordynacja punktu końcowego kurwy.
y4
float
Y-koordynacja punktu końcowego kurwy.
Exceptions
pen’ is null.
DrawBezier(Pieniądze: PointF, PointF, PointF)
Drukuje spline Bézier zdefiniowane przez cztery struktury Aspose.Imaging.PointF.
public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kurwy.
pt1
PointF
Aspose.Imaging.Struktura punktu, która reprezentuje punkt wyjścia kurwy.
pt2
PointF
Aspose.Imaging.Struktura punktu, która reprezentuje pierwszy punkt kontrolny dla kurwy.
pt3
PointF
Aspose.Imaging.Struktura punktu, która reprezentuje drugi punkt kontrolny dla kurwy.
pt4
PointF
Aspose.Imaging.Struktura punktu, która reprezentuje punkt końcowy kurwy.
Exceptions
pen’ is null.
DrawBezier(punkt, punkt, punkt, punkt)
Drukuje spline Bézier zdefiniowane przez cztery struktury Aspose.Imaging.punktu.
public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
Parameters
pen
Pen
Aspose.Imaging.Struktura penu, która określa kolor, szerokość i styl kurwy.
pt1
Point
Aspose.Imaging.Struktura punktu, która reprezentuje punkt wyjścia kurwy.
pt2
Point
Aspose.Imaging.Struktura punktów reprezentująca pierwszy punkt kontrolny dla kurwy.
pt3
Point
Aspose.Imaging.Struktura punktu, która reprezentuje drugą punkt kontrolny dla kurwy.
pt4
Point
Aspose.Imaging.Struktura punktu, która reprezentuje punkt końcowy kurwy.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, punkt[])
Wyciąga serię plików Bézier z szeregu struktur Aspose.Imaging.Point.
public void DrawBeziers(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kurwy.
points
Point
[ ]
Różnica Aspose.Imaging.Struktura punktów reprezentująca punkty, które określają kurtkę.
Exceptions
pen’ is null.-or-
points’ is null.
DrawBeziers(Pieniądze, PointF[])
Wyciąga serię plików Bézier z szeregu struktur Aspose.Imaging.PointF.
public void DrawBeziers(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF reprezentujących punkty, które określają kurtkę.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Pieniądze, PointF[])
Wyciąga zamknięty kardinalny spline zdefiniowany przez szereg struktur Aspose.Imaging.PointF. Ta metoda wykorzystuje domyślną napięcie 0,5 i W L17.FillMode.Alternate trybu wypełnienia.
public void DrawClosedCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Pieniądze, PointF[ ], Floty)
Wyciąga zamknięty kardinalny spline zdefiniowany przez szereg struktur Aspose.Imaging.PointF przy użyciu określonego napięcia.
public void DrawClosedCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Pieniądze, punkt[])
Wyciąga zamknięty kardinalny spline zdefiniowany przez szereg struktur Aspose.Imaging.Point. Ta metoda wykorzystuje domyślną napięcie 0.5 i W L17.FillMode.Alternate trybu wypełnienia.
public void DrawClosedCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Pieniądze, punkt[ ], Floty)
Wyciąga zamknięty kardinalny spline zdefiniowany przez szereg struktur Aspose.Imaging.Point przy użyciu określonego napięcia. ta metoda wykorzystuje domyślny tryb wypełniania W L17.FillMode.Alternate.
public void DrawClosedCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Pieniądze, PointF[])
Wyciąga kardynał spline przez określony zakres struktur Aspose.Imaging.PointF. Ta metoda wykorzystuje domyślną napięcie 0.5.
public void DrawCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Pieniądze, PointF[ ], Floty)
Wyciąga kardynał spline przez określony zakres struktur Aspose.Imaging.PointF za pomocą określonego napięcia.
public void DrawCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF reprezentujących punkty, które określają kurtkę.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Pieniądze, PointF[ ], int , int)
Wyciąga kardynał spline przez określony zakres struktur Aspose.Imaging.PointF. Rysunek rozpoczyna się od początku rysunku.Metoda ta wykorzystuje napięcie domyślne 0.5.
public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
offset
int
Odłącz z pierwszego elementu w kolejce parametrów punkty do punktu wyjścia w kurwie.
numberOfSegments
int
Liczba segmentów po punkcie wyjścia do uwzględnienia w kurwie.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Pieniądze, PointF[ ], int , int , float)
Drukuje kardynał spline przez określony zakres struktur Aspose.Imaging.PointF przy użyciu określonego napięcia.
public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
offset
int
Odłącz z pierwszego elementu w kolejce parametrów punkty do punktu wyjścia w kurwie.
numberOfSegments
int
Liczba segmentów po punkcie wyjścia do uwzględnienia w kurwie.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Pieniądze, punkt[])
Wyciąga kardynał spline przez określony zakres struktur Aspose.Imaging.Point.
public void DrawCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, punkt[ ], Floty)
Wyciąga kardynał spline przez określony zakres struktur Aspose.Imaging.punktu za pomocą określonego napięcia.
public void DrawCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Pieniądze, punkt[ ], int , int , float)
Wyciąga kardynał spline przez określony zakres struktur Aspose.Imaging.punktu za pomocą określonego napięcia.
public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i wysokość kurwy.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
offset
int
Odłącz z pierwszego elementu w kolejce parametrów punkty do punktu wyjścia w kurwie.
numberOfSegments
int
Liczba segmentów po punkcie wyjścia do uwzględnienia w kurwie.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
pen’ is null.-or-
points’ is null.
DrawEllipse(Pieniądze, RectangleF)
Wyciąga elips określony przez granicę Aspose.Imaging.RectangleF.
public void DrawEllipse(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl elipsy.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która definiuje granice elipsy.
Exceptions
pen’ is null.
DrawEllipse(Pieniądze, float, float, float)
Wyciąga ellipsa zdefiniowana przez obwodowy rektangul określony przez parę współrzędnych, wysokość i szerokość.
public void DrawEllipse(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl elipsy.
x
float
X-koordynacja górnego lewego rogu rektangularnego, który definiuje ellipsa.
y
float
Y-koordynat górnego lewego rogu rektangularnego, który definiuje ellipsa.
width
float
Szerokość okrągłego rektaku, który definiuje elips.
height
float
Wysokość obwodowego rektangulu, który definiuje elips.
Exceptions
pen’ is null.
DrawEllipse(Pielęgnacja, rektangle)
Wyciąga elips określony przez strukturę graniczną Aspose.Imaging.Rectangle.
public void DrawEllipse(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl elipsy.
rect
Rectangle
WL17_.Struktura rektangularna, która określa granice elipsy.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, int, int, int, int)
Wyciąga ellipsa zdefiniowana przez obwodowy rektangul określony przez parę współrzędnych, wysokość i szerokość.
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl elipsy.
x
int
X-koordynacja górnego lewego rogu rektangularnego, który definiuje ellipsa.
y
int
Y-koordynat górnego lewego rogu rektangularnego, który definiuje ellipsa.
width
int
Szerokość okrągłego rektaku, który definiuje elips.
height
int
Wysokość obwodowego rektangulu, który definiuje elips.
Exceptions
pen’ is null.
DrawImage(Zdjęcie, PointF)
Wyświetla określony Aspose.Imaging.Graphics.Image, używając jego oryginalnego rozmiaru fizycznego, w określonym miejscu.
public void DrawImage(Image sourceImage, PointF point)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
point
PointF
Aspose.Imaging.Struktura PointF reprezentująca lewą górną rogię obrazu wyciągniętego.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, float, float)
Wyświetla określony Aspose.Imaging.Graphics.Image, używając jego oryginalnego rozmiaru fizycznego, w określonym miejscu.
public void DrawImage(Image sourceImage, float x, float y)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
x
float
X-koordynacja górnego lewego rogu obrazu.
y
float
Y-koordynacja górnego lewego rogu obrazu.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, RectangleF)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, RectangleF rect)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która określa lokalizację i rozmiar wyciągniętego obrazu.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcia, Rectangle, GraphicsUnit)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectDestination
Rectangle
Docelowy rektangul.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcia, RectangleF, GraphicsUnit)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectDestination
RectangleF
Docelowy rektangul.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, Rectangle, GraphicsUnit, ImageAttributes)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectDestination
Rectangle
Docelowy rektangul.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
imageAttributes
ImageAttributes
Wizerunek charakteryzuje się atrybutami.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, RectangleF, GraphicsUnit, ImageAttributes)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectDestination
RectangleF
Docelowy rektangul do wyciągnięcia.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
imageAttributes
ImageAttributes
Wizerunek charakteryzuje się atrybutami.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, Rectangle, Rectangle, Grafika)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectSource
Rectangle
Źródło rect.
rectDestination
Rectangle
Docelowy kierunek rektalny.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcia, RectangleF, RectangleF, GraphicsUnit)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectSource
RectangleF
Źródło rect.
rectDestination
RectangleF
Docelowy kierunek rektalny.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, Rectangle, Rectangle, GraphicsUnit, ImageAttributes)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectSource
Rectangle
Źródło rect.
rectDestination
Rectangle
Docelowy kierunek rektalny.
graphicsUnit
GraphicsUnit
Jednostka graficzna .
imageAttributes
ImageAttributes
Wizerunek charakteryzuje się atrybutami.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, RectangleF, RectangleF, GraphicsUnit, ImageAttributes)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rectSource
RectangleF
Źródło rektangularne.
rectDestination
RectangleF
Docelowy rektangul.
graphicsUnit
GraphicsUnit
Jednostka graficzna do użycia.
imageAttributes
ImageAttributes
Zdjęcie przypisuje do użycia.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, punkt[])
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, Point[] destPoints)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
Point
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
DrawImage(Zdjęcie, punkt[ ], i rektangle)
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
Point
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
srcRect
Rectangle
Źródło rektangularne.
DrawImage(Zdjęcie, punkt[ ], Rectangle , GraphicsUnit)
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
Point
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
srcRect
Rectangle
Źródło rektangularne.
srcUnit
GraphicsUnit
Jednostki do pomiaru.
DrawImage(Zdjęcie, punkt[ ], Rectangle, GraphicsUnit, Atrybuty obrazu)
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
Point
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
srcRect
Rectangle
Źródło rektangularne.
srcUnit
GraphicsUnit
Jednostki do pomiaru.
imageAttributes
ImageAttributes
Wizerunek charakteryzuje się atrybutami.
DrawImage(Zdjęcie, PointF[])
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
PointF
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
Exceptions
Zdjęcie
DrawImage(Zdjęcie, PointF[ ], RectangleF)
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
PointF
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
srcRect
RectangleF
Źródło rektangularne.
DrawImage(Zdjęcie, PointF[ ], RectangleF, GraphicsUnit)
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
PointF
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
srcRect
RectangleF
Źródło rektangularne.
srcUnit
GraphicsUnit
Jednostki do pomiaru.
DrawImage(Zdjęcie, PointF[ ], RectangleF, GraphicsUnit, Atrybuty obrazu)
Wyciągnij określoną część określonego image’ w określonym miejscu i przy określonym rozmiarze.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Zdjęcie do rysowania.
destPoints
PointF
[ ]
Zestaw trzech struktur PointF, które określają równoległość.
srcRect
RectangleF
Źródło rektangularne.
srcUnit
GraphicsUnit
Jednostki do pomiaru.
imageAttributes
ImageAttributes
Wizerunek charakteryzuje się atrybutami.
DrawImage(Zdjęcie, float, float, float, float)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, float x, float y, float width, float height)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
x
float
X-koordynacja górnego lewego rogu obrazu.
y
float
Y-koordynacja górnego lewego rogu obrazu.
width
float
Szerokość wyciągniętego obrazu.
height
float
Wysokość wyciągniętego obrazu.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, punkt)
Wyświetla określony Aspose.Imaging.Graphics.Image, używając jego oryginalnego rozmiaru fizycznego, w określonym miejscu.
public void DrawImage(Image sourceImage, Point point)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
point
Point
Aspose.Imaging.Struktura punktów reprezentująca lokalizację lewego górnego rogu obrazu.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, int, int)
Wyciąga określony obraz, używając jego oryginalnego rozmiaru fizycznego, w miejscu określonym przez parę współrzędnych.
public void DrawImage(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
x
int
X-koordynacja górnego lewego rogu obrazu.
y
int
Y-koordynacja górnego lewego rogu obrazu.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, Rectangle)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rect
Rectangle
Aspose.Imaging.Struktura rektangularna, która określa lokalizację i rozmiar nagranego obrazu.
Exceptions
sourceImage’ is null.
DrawImage(Zdjęcie, int, int, int, int)
Wprowadź określony Aspose.Imaging.Graphics.Image w określającej lokalizacji i z określonym rozmiarem.
public void DrawImage(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
x
int
X-koordynacja górnego lewego rogu obrazu.
y
int
Y-koordynacja górnego lewego rogu obrazu.
width
int
Szerokość wyciągniętego obrazu.
height
int
Wysokość wyciągniętego obrazu.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Zdjęcie, punkt)
Wyświetla określony obraz za pomocą jego oryginalnego rozmiaru fizycznego w określonej lokalizacji.
public void DrawImageUnscaled(Image sourceImage, Point point)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
point
Point
Aspose.Imaging.Struktura punktu, która określa górny lewy kąt wyciągniętego obrazu.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Zdjęcie, int, int)
Wyciąga określony obraz za pomocą jego oryginalnego rozmiaru fizycznego w miejscu określonym przez parę koordynatów.
public void DrawImageUnscaled(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
x
int
X-koordynacja górnego lewego rogu obrazu.
y
int
Y-koordynacja górnego lewego rogu obrazu.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Zdjęcie, Rectangle)
Wyświetla określony obraz za pomocą jego oryginalnego rozmiaru fizycznego w określonej lokalizacji.
public void DrawImageUnscaled(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rect
Rectangle
Aspose.Imaging.Rectangle, który określa górny lewym rogiem obrazu wyciągniętego. właściwości X i Y rektangla określają górne lewego rogu.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Zdjęcie, int, int, int, int)
Wyświetla określony obraz za pomocą jego oryginalnego rozmiaru fizycznego w określonej lokalizacji.
public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
x
int
X-koordynacja górnego lewego rogu obrazu.
y
int
Y-koordynacja górnego lewego rogu obrazu.
width
int
Parametry nie są używane.
height
int
Parametry nie są używane.
Exceptions
sourceImage’ is null.
DrawImageUnscaledAndClipped(Zdjęcie, Rectangle)
Wyciąga określony obraz bez skalowania i klipi go, jeśli to konieczne, aby dopasować się do określonej prawicy.
public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Zdjęcie do wyciągnięcia.
rect
Rectangle
Aspose.Imaging.Rectangle, w którym można wykresować obraz.
Exceptions
sourceImage’ is null.
DrawLine(Punkty, punkty i punkty)
Wyciąga linię łączącą dwie struktury Aspose.Imaging.Point.
public void DrawLine(Pen pen, Point point1, Point point2)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl linii.
point1
Point
Aspose.Imaging.Struktura punktu, która reprezentuje pierwszy punkt do połączenia.
point2
Point
Aspose.Imaging.Struktura punktu, która reprezentuje drugi punkt do połączenia.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze PointF, PointF)
Wyciąga linię łączącą dwie struktury Aspose.Imaging.PointF.
public void DrawLine(Pen pen, PointF point1, PointF point2)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl linii.
point1
PointF
Struktura Aspose.Imaging.PointF, która jest pierwszym punktem do połączenia.
point2
PointF
Aspose.Imaging.Struktura punktu, która reprezentuje drugi punkt do połączenia.
Exceptions
pen’ is null.
DrawLine(Pieniądze, int, int, int, int)
Wyciąga linię łączącą dwa punkty określone przez pary współrzędnych.
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl linii.
x1
int
Koordynacja x w pierwszym punkcie.
y1
int
Koordynacja w pierwszym punkcie.
x2
int
Koordynacja X w drugim punkcie.
y2
int
Koordynacja w drugim punkcie.
Exceptions
pen’ is null.
DrawLine(Pieniądze, float, float, float)
Wyciąga linię łączącą dwa punkty określone przez pary współrzędnych.
public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl linii.
x1
float
Koordynacja x w pierwszym punkcie.
y1
float
Koordynacja w pierwszym punkcie.
x2
float
Koordynacja X w drugim punkcie.
y2
float
Koordynacja w drugim punkcie.
Exceptions
pen’ is null.
DrawLines(Pieniądze, punkt[])
Wyciąga serię segmentów linii, które łączą szereg struktur Aspose.Imaging.Point.
public void DrawLines(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl segmentów linii.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które reprezentują punkty do połączenia.
Exceptions
pen’ is null.-or-
points’ is null.
Rada punktów zawiera mniej niż 2 punkty.
DrawLines(Pieniądze, PointF[])
Wyciąga serię segmentów linii, które łączą szereg struktur Aspose.Imaging.PointF.
public void DrawLines(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl segmentów linii.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które reprezentują punkty do połączenia.
Exceptions
pen’ is null.-or-
points’ is null.
Rada punktów zawiera mniej niż 2 punkty.
DrawPath(Pióro, GraphicsPath)
Wyświetl Aspose.Imaging.GraphicsPath.
public void DrawPath(Pen pen, GraphicsPath path)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl drogi.
path
GraphicsPath
Aspose.Imaging.GrafikaPath do rysowania.
Examples
Przykłady te wykorzystują klasę GraphicsPath i grafiki do tworzenia i manipulowania figurami na powierzchni obrazu. Przykład tworzy nową obraz (typu Tiff), oczyszcza powierzchnię i wyciąga ścieżki za pomocą klasy Grafiki.
//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(Pen, RectangleF, float, float)
Wyciąga kształt pie definitywany przez elips określony przez strukturę Aspose.Imaging.RectangleF i dwie linie radialne.
public void DrawPie(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kształtu pie.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która reprezentuje obwodowy rektangul, który definiuje elips, z którego pochodzi forma pie.
startAngle
float
Węgiel mierzony w stopniach zegarowych od osi x do pierwszej strony kształtu pie.
sweepAngle
float
Węgiel mierzony w stopniach węgielnych od parametru startAngle’ do drugiej strony kształtu pie.
Exceptions
pen’ is null.
DrawPie(Pieniądze, float, float, float, float, float)
Wyciąga kształt pie definitywany przez elips określony przez parę współrzędnych, szerokość, wysokość i dwie linie radialne.
public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kształtu pie.
x
float
X-koordynacja górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi kształt pie.
y
float
Y-koordynacja górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi kształt pie.
width
float
Szerokość obwodu, który określa eliksę, z której pochodzi kształt pie.
height
float
Wysokość obwodowego rektangulu, który określa elips, z którego pochodzi kształt pie.
startAngle
float
Węgiel mierzony w stopniach zegarowych od osi x do pierwszej strony kształtu pie.
sweepAngle
float
Węgiel mierzony w stopniach węgielnych od parametru startAngle’ do drugiej strony kształtu pie.
Exceptions
pen’ is null.
DrawPie(Pen, rektangle, float, float)
Wyciąga kształt pie definitywany przez elips określony przez strukturę Aspose.Imaging.Rectangle i dwie linie radialne.
public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kształtu pie.
rect
Rectangle
WL17_.Struktura rektangularna, która reprezentuje obwodowy rectangul, który definiuje elips, z którego pochodzi forma pie.
startAngle
float
Węgiel mierzony w stopniach zegarowych od osi x do pierwszej strony kształtu pie.
sweepAngle
float
Węgiel mierzony w stopniach węgielnych od parametru startAngle’ do drugiej strony kształtu pie.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, int, int, int, int, int, int)
Wyciąga kształt pie definitywany przez elips określony przez parę współrzędnych, szerokość, wysokość i dwie linie radialne.
public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl kształtu pie.
x
int
X-koordynacja górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi kształt pie.
y
int
Y-koordynacja górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi kształt pie.
width
int
Szerokość obwodu, który określa eliksę, z której pochodzi kształt pie.
height
int
Wysokość obwodowego rektangulu, który określa elips, z którego pochodzi kształt pie.
startAngle
int
Węgiel mierzony w stopniach zegarowych od osi x do pierwszej strony kształtu pie.
sweepAngle
int
Węgiel mierzony w stopniach węgielnych od parametru startAngle’ do drugiej strony kształtu pie.
Exceptions
pen’ is null.
DrawPolygon(Pieniądze, PointF[])
Wyciąga poligon zdefiniowany przez szereg struktur Aspose.Imaging.PointF.
public void DrawPolygon(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl poligonu.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które reprezentują piony poligonu.
Exceptions
pen’ is null.-or-
points’ is null.
DrawPolygon(Pieniądze, punkt[])
Wyciąga poligon zdefiniowany przez szereg struktur Aspose.Imaging.punktu.
public void DrawPolygon(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl poligonu.
points
Point
[ ]
Różnica Aspose.Imaging.Struktura punktów, które reprezentują szczyty poligonu.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, RectangleF)
Wyciąga prostokąt określony przez strukturę Aspose.Imaging.RectangleF.
public void DrawRectangle(Pen pen, RectangleF rect)
Parameters
pen
Pen
A Aspose.Imaging.Pen, który określa kolor, szerokość i styl rektaku.
rect
RectangleF
Struktura Aspose.Imaging.RectangleF reprezentująca rektangulę do wyciągania.
Exceptions
pen’ is null.
DrawRectangle(Pielęgnacja, rektangle)
Wyciąga prostokąt określony przez strukturę Aspose.Imaging.Rectangle.
public void DrawRectangle(Pen pen, Rectangle rect)
Parameters
pen
Pen
A Aspose.Imaging.Pen, który określa kolor, szerokość i styl rektaku.
rect
Rectangle
Struktura Aspose.Imaging.Rectangle, która reprezentuje rektanglu do wyciągania.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//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(Pieniądze, float, float, float)
Wyciąga prostokąt określony przez parę koordynat, szerokość i wysokość.
public void DrawRectangle(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
A Aspose.Imaging.Pen, który określa kolor, szerokość i styl rektaku.
x
float
X-koordynacja górnego lewego rogu rektaku do wyciągania.
y
float
Y-koordynacja górnego lewego rogu rektanu do wyciągnięcia.
width
float
Szerokość rektaku do wyciągnięcia.
height
float
Wysokość rektaku do wyciągnięcia.
Exceptions
pen’ is null.
DrawRectangle(Pieniądze, int, int, int, int)
Wyciąga prostokąt określony przez parę koordynat, szerokość i wysokość.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl prostokąt.
x
int
X-koordynacja górnego lewego rogu rektaku do wyciągania.
y
int
Y-koordynacja górnego lewego rogu rektanu do wyciągnięcia.
width
int
Szerokość rektaku do wyciągania.
height
int
Wysokość rektaku do wyciągnięcia.
Exceptions
pen’ is null.
DrawRectangles(Pieniądze, RectangleF[])
Wyświetla szereg prostokątów określonych przez struktury Aspose.Imaging.RectangleF.
public void DrawRectangles(Pen pen, RectangleF[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl wyciągów rektangularnych.
rects
RectangleF
[ ]
Zestaw struktur Aspose.Imaging.RectangleF, które reprezentują rektan do wyciągania.
Exceptions
pen’ is null.-or-
rects’ is null.
DrawRectangles(Pielęgnacja, rektangle[])
Wyciąga szereg prostokątów określonych przez Aspose.Imaging.Rectangle struktury.
public void DrawRectangles(Pen pen, Rectangle[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen, który określa kolor, szerokość i styl wyciągów rektangularnych.
rects
Rectangle
[ ]
Array Aspose.Imaging.Rectangle struktury, które reprezentują rektangły do wyciągania.
Examples
Ten przykład pokazuje tworzenie i używanie obiektów Pen. Przykład tworzy nowy obraz i rysuje Rectangles na powierzchni obrazu.
//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(String, Font, Brush, float, float)
Wpisz określony pasek tekstowy w określonym miejscu przy użyciu ustalonych przedmiotów Aspose.Imaging.Brush i W L17.Font.
public void DrawString(string s, Font font, Brush brush, float x, float y)
Parameters
s
string
Rękawiczki do wyciągnięcia.
font
Font
Aspose.Imaging.Font, który definiuje format tekstu paska.
brush
Brush
Aspose.Imaging.Brush, który określa kolor i teksturę wyciągniętego tekstu.
x
float
X-koordynacja górnego lewego rogu tekstu.
y
float
Y-koordynacja górnego lewego rogu wykręconego tekstu.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Źródło: Brush, PointF)
Wpisz określony pasek tekstowy w określonym miejscu przy użyciu ustalonych przedmiotów Aspose.Imaging.Brush i W L17.Font.
public void DrawString(string s, Font font, Brush brush, PointF point)
Parameters
s
string
Rękawiczki do wyciągnięcia.
font
Font
Aspose.Imaging.Font, który definiuje format tekstu paska.
brush
Brush
Aspose.Imaging.Brush, który określa kolor i teksturę wyciągniętego tekstu.
point
PointF
Aspose.Imaging.Struktura PointF, która określa górny lewy kąt tekstu wyciągniętego.
Examples
Przykład ten wykorzystuje klasę graficzną do tworzenia pierwotnych kształtów na powierzchni obrazu. Aby pokazać działanie, przykład tworzy nową obraz w formacie PNG i rysuje pierwotne kształty na powierzchnię obraza za pomocą metod Rysowania narażonych przez klasy graficzne
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(String, Font, Brush, Float, Float, StringFormat)
Wprowadź określony pasek tekstowy w określonym miejscu przy użyciu konkretnych przedmiotów Aspose.Imaging.Brush i __Font, wykorzystując atrybuty formatowania konkretnego W L17.StringFormat.
public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format)
Parameters
s
string
Rękawiczki do wyciągnięcia.
font
Font
Aspose.Imaging.Font, który definiuje format tekstu paska.
brush
Brush
Aspose.Imaging.Brush, który określa kolor i teksturę wyciągniętego tekstu.
x
float
X-koordynacja górnego lewego rogu tekstu.
y
float
Y-koordynacja górnego lewego rogu wykręconego tekstu.
format
StringFormat
Aspose.Imaging.StringFormat, który określa atrybuty formatowania, takie jak przestrzeń linii i alignment, które są stosowane do wyciągniętego tekstu.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(String, Font, Brush, PointF, StringFormat)
Wprowadź określony pasek tekstowy w określonym miejscu przy użyciu konkretnych przedmiotów Aspose.Imaging.Brush i __Font, wykorzystując atrybuty formatowania konkretnego W L17.StringFormat.
public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)
Parameters
s
string
Rękawiczki do wyciągnięcia.
font
Font
Aspose.Imaging.Font, który definiuje format tekstu paska.
brush
Brush
Aspose.Imaging.Brush, który określa kolor i teksturę wyciągniętego tekstu.
point
PointF
Aspose.Imaging.Struktura PointF, która określa górny lewy kąt tekstu wyciągniętego.
format
StringFormat
Aspose.Imaging.StringFormat, który określa atrybuty formatowania, takie jak przestrzeń linii i alignment, które są stosowane do wyciągniętego tekstu.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(String, Font, Brush, RectangleF)
Wpisz określony pasek tekstowy w określonym prostokątzie za pomocą przedmiotów wskazanych Aspose.Imaging.Brush i __Font.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)
Parameters
s
string
Rękawiczki do wyciągnięcia.
font
Font
Aspose.Imaging.Font, który definiuje format tekstu paska.
brush
Brush
Aspose.Imaging.Brush, który określa kolor i teksturę wyciągniętego tekstu.
layoutRectangle
RectangleF
Aspose.Imaging.RectangleF struktura, która określa lokalizację wyciągniętego tekstu.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(String, Font, Brush, RectangleF, StringFormat)
Wpisz określony pasek tekstowy w określonym prostokątzie za pomocą określanego przedmiotu Aspose.Imaging.Brush i __Font, korzystając z atrybutów formatowania określenego W L17.StringFormat.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
Parameters
s
string
Rękawiczki do wyciągnięcia.
font
Font
Aspose.Imaging.Font, który definiuje format tekstu paska.
brush
Brush
Aspose.Imaging.Brush, który określa kolor i teksturę wyciągniętego tekstu.
layoutRectangle
RectangleF
Aspose.Imaging.RectangleF struktura, która określa lokalizację wyciągniętego tekstu.
format
StringFormat
Aspose.Imaging.StringFormat, który określa atrybuty formatowania, takie jak przestrzeń linii i alignment, które są stosowane do wyciągniętego tekstu.
Exceptions
brush’ is null.-or-
s’ is null.-or-
brush’ is null.
EndUpdate()
Zakończy się caching operacji graficznych, które rozpoczęły się po wezwaniu StartUpdate. poprzednie operacje graficzne zostaną zastosowane natychmiast przy wezwaniu tej metody.
public void EndUpdate()
FillClosedCurve(Brush i PointF[])
Wypełnia wnętrze zamkniętej kardinolowej skrzyni określonej przez szereg struktur Aspose.Imaging.PointF. Metoda ta wykorzystuje domyślną napięcie 0,5 i W L17.FillMode.Alternate trybu wypełnienia.
public void FillClosedCurve(Brush brush, PointF[] points)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Brush i PointF[ ], i FillMode)
Wypełnia wnętrze zamkniętego kardinalu skrętu określonej przez szereg struktur Aspose.Imaging.PointF przy użyciu określonego trybu wypełniania.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
fillMode
FillMode
Członek listy Aspose.Imaging.FillMode, która określa, w jaki sposób zakręt jest wypełniony.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Brush i PointF[ ], FillMode , Float)
Wypełnia wnętrze zamkniętej kardinolowej skrzydła określonej przez szereg struktur Aspose.Imaging.PointF przy użyciu określonego trybu wypełniania i napięcia.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
A Aspose.Imaging.Brush, który określa cechy wypełnienia.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które określają spline.
fillmode
FillMode
Członek listy Aspose.Imaging.FillMode, która określa, w jaki sposób zakręt jest wypełniony.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Brąz, punkt[])
Wypełnia wnętrze zamkniętego kardinalu skrętu określonego przez szereg struktur Aspose.Imaging.Point. ta metoda wykorzystuje domyślną napięcie 0,5 i W L17.FillMode.Alternate trybu wypełnienia.
public void FillClosedCurve(Brush brush, Point[] points)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Brąz, punkt[ ], i FillMode)
Wypełnić wnętrze zamkniętego kardinalu kręgosłupa zdefiniowany przez szereg struktur Aspose.Imaging.Poziom za pomocą określonego trybu wypełnienia.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
fillmode
FillMode
Członek listy Aspose.Imaging.FillMode, która określa, w jaki sposób zakręt jest wypełniony.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Brąz, punkt[ ], FillMode , Float)
Wypełnia wnętrze zamkniętej kardinolowej skrzyni określonej przez szereg struktur Aspose.Imaging.punktu przy użyciu określonego trybu wypełniania i napięcia.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które określają spline.
fillmode
FillMode
Członek listy Aspose.Imaging.FillMode, która określa, w jaki sposób zakręt jest wypełniony.
tension
float
Wartość większa lub równa 0,0F, która określa napięcie kurwy.
Exceptions
brush’ is null.-or-
points’ is null.
FillEllipse(Bruszka, RectangleF)
Wypełnia wnętrze elipsy zdefiniowanej przez obwodowy rektangul określony przez strukturę Aspose.Imaging.RectangleF.
public void FillEllipse(Brush brush, RectangleF rect)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która reprezentuje obwodowy rektangul, który definiuje ellipsa.
Exceptions
brush’ is null.
FillEllipse(Brush, float, float, float, float)
Wypełnia wnętrze elipsy zdefiniowanej przez obwodowy rektangul określony przez parę współrzędnych, szerokość i wysokość.
public void FillEllipse(Brush brush, float x, float y, float width, float height)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
x
float
X-koordynacja górnego lewego rogu rektangularnego, który definiuje ellipsa.
y
float
Y-koordynat górnego lewego rogu rektangularnego, który definiuje ellipsa.
width
float
Szerokość okrągłego rektaku, który definiuje elips.
height
float
Wysokość obwodowego rektangulu, który definiuje elips.
Exceptions
brush’ is null.
FillEllipse(Brązowy, Rectangle)
Wypełnia wnętrze elipsy zdefiniowanej przez obręczy rektangularny określony przez strukturę Aspose.Imaging.Rectangle.
public void FillEllipse(Brush brush, Rectangle rect)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rect
Rectangle
WL17_.Struktura rektangularna, która reprezentuje obwodowy rectangul, który definiuje ellipsa.
Exceptions
brush’ is null.
FillEllipse(Brush, int, int, int, int)
Wypełnia wnętrze elipsy zdefiniowanej przez obwodowy rektangul określony przez parę współrzędnych, szerokość i wysokość.
public void FillEllipse(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
x
int
X-koordynacja górnego lewego rogu rektangularnego, który definiuje ellipsa.
y
int
Y-koordynat górnego lewego rogu rektangularnego, który definiuje ellipsa.
width
int
Szerokość okrągłego rektaku, który definiuje elips.
height
int
Wysokość obwodowego rektangulu, który definiuje elips.
Exceptions
brush’ is null.
FillPath(Brush i GraphicsPath)
Wypełnia wnętrze Aspose.Imaging.GraphicsPath.
public void FillPath(Brush brush, GraphicsPath path)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
path
GraphicsPath
Aspose.Imaging.GrafikaPath, który reprezentuje ścieżkę do wypełnienia.
Exceptions
brush’ is null.-or-
path’ is null.
FillPie(Brush, rektangle, float, float)
Wypełnia wnętrze sekcji pie definitywanej przez elips określony przez strukturę Aspose.Imaging.RectangleF i dwie linie radialne.
public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rect
Rectangle
Aspose.Imaging.Struktura rektangularna, która reprezentuje obwodowy rectangul, który definiuje elips, z którego pochodzi sekcja pie.
startAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do pierwszej strony sekcji pie.
sweepAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy z parametru startAngle’ do drugiej strony sekcji pie.
Examples
Poniższy przykład pokazuje, jak tworzyć animowany obraz GIF z poszczególnych bloków 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(Brush, RectangleF, float, float)
Wypełnia wnętrze sekcji pie definitywanej przez elips określony przez strukturę Aspose.Imaging.RectangleF i dwie linie radialne.
public void FillPie(Brush brush, RectangleF rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która reprezentuje obwodowy rektangul, który definiuje elips, z którego pochodzi sekcja pie.
startAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do pierwszej strony sekcji pie.
sweepAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy z parametru startAngle’ do drugiej strony sekcji pie.
Exceptions
brush’ is null.
FillPie(Brush, float, float, float, float, float, float)
Wypełnia wnętrze sekcji pie definitywanej przez elips określony przez parę współrzędnych, szerokość, wysokość i dwie linie radialne.
public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
x
float
X-koordynacja górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi sekcja pie.
y
float
Y-koordynata górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi odcinek pie.
width
float
Szerokość obwodu, który określa elips, z którego pochodzi sekcja pie.
height
float
Wysokość obwodowego rektangulu, który określa elips, z którego pochodzi sekcja pie.
startAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do pierwszej strony sekcji pie.
sweepAngle
float
Węgiel w stopniach mierzony w sposób zegarkowy z parametru startAngle’ do drugiej strony sekcji pie.
Exceptions
brush’ is null.
FillPie(Brush, int, int, int, int, int, int, int)
Wypełnia wnętrze sekcji pie definitywanej przez elips określony przez parę współrzędnych, szerokość, wysokość i dwie linie radialne.
public void FillPie(Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
x
int
X-koordynacja górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi sekcja pie.
y
int
Y-koordynata górnego lewego rogu rektangularnego, który określa elips, z którego pochodzi odcinek pie.
width
int
Szerokość obwodu, który określa elips, z którego pochodzi sekcja pie.
height
int
Wysokość obwodowego rektangulu, który określa elips, z którego pochodzi sekcja pie.
startAngle
int
Węgiel w stopniach mierzony w sposób zegarkowy od osi x do pierwszej strony sekcji pie.
sweepAngle
int
Węgiel w stopniach mierzony w sposób zegarkowy z parametru startAngle’ do drugiej strony sekcji pie.
Exceptions
brush’ is null.
FillPolygon(Brush i PointF[])
Wypełnia wnętrze poligonu zdefiniowanego przez szereg punktów określonych przez struktury Aspose.Imaging.PointF i __ WL 17__ .FillMode.Alternate.
public void FillPolygon(Brush brush, PointF[] points)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które reprezentują szczyty poligonu do wypełnienia.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Brush i PointF[ ], i FillMode)
Wypełnia wnętrze poligonu zdefiniowanego przez szereg punktów określonych przez struktury Aspose.Imaging.PointF za pomocą określonego trybu wypełnienia.
public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
PointF
[ ]
Zestaw struktur Aspose.Imaging.PointF, które reprezentują szczyty poligonu do wypełnienia.
fillMode
FillMode
Członek listy Aspose.Imaging.FillMode, która określa styl wypełnienia.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Brąz, punkt[])
Wypełnia wnętrze poligonu zdefiniowanego przez szereg punktów określonych przez Aspose.Imaging.Struktury punktowe i W L 17.FillMode.Alternate.
public void FillPolygon(Brush brush, Point[] points)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które reprezentują szczyty poligonu do wypełnienia.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Brąz, punkt[ ], i FillMode)
Wypełnia wnętrze poligonu zdefiniowanego przez szereg punktów określonych przez struktury Aspose.Imaging.punktu za pomocą określonego trybu wypełnienia.
public void FillPolygon(Brush brush, Point[] points, FillMode fillMode)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
points
Point
[ ]
Zestaw Aspose.Imaging.Struktura punktów, które reprezentują szczyty poligonu do wypełnienia.
fillMode
FillMode
Członek listy Aspose.Imaging.FillMode, która określa styl wypełnienia.
Exceptions
brush’ is null.-or-
points’ is null.
FillRectangle(Brązowy, Rectangle)
Wypełnia wnętrze rektaku określonego przez strukturę Aspose.Imaging.Rectangle.
public void FillRectangle(Brush brush, Rectangle rect)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rect
Rectangle
Aspose.Imaging.Struktura rektangularna, która reprezentuje prawy kąt do wypełnienia.
Exceptions
brush’ is null.
FillRectangle(Bruszka, RectangleF)
Wypełnia wnętrze rektaku określonego przez strukturę Aspose.Imaging.RectangleF.
public void FillRectangle(Brush brush, RectangleF rect)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rect
RectangleF
Aspose.Imaging.RectangleF struktura, która reprezentuje rektangulę do wypełnienia.
Exceptions
brush’ is null.
FillRectangle(Brush, float, float, float, float)
Wypełnia wnętrze prostokątów określonych przez parę współrzędnych, szerokość i wysokość.
public void FillRectangle(Brush brush, float x, float y, float width, float height)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
x
float
X-koordynacja górnego lewego rogu prawnego do wypełnienia.
y
float
Y-koordynacja górnego lewego rogu rektanu do wypełnienia.
width
float
Szerokość rektaku do wypełnienia.
height
float
Wysokość rektaku do wypełnienia.
Exceptions
brush’ is null.
FillRectangle(Brush, int, int, int, int)
Wypełnia wnętrze prostokątów określonych przez parę współrzędnych, szerokość i wysokość.
public void FillRectangle(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
x
int
X-koordynacja górnego lewego rogu prawnego do wypełnienia.
y
int
Y-koordynacja górnego lewego rogu rektanu do wypełnienia.
width
int
Szerokość rektaku do wypełnienia.
height
int
Wysokość rektaku do wypełnienia.
Exceptions
brush’ is null.
FillRectangles(Brązowy, Rectangle[])
Wypełnia wnętrza serii rektangulów określonych przez Aspose.Imaging.Rectangle struktury.
public void FillRectangles(Brush brush, Rectangle[] rects)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rects
Rectangle
[ ]
Array Aspose.Imaging.Rectangle struktury, które reprezentują rektangły do wypełnienia.
Exceptions
brush’ is null or
rects’ is null.
FillRectangles(Bruszka, RectangleF[])
Wypełnia wnętrza szeregu prostokątów określonych przez struktury Aspose.Imaging.RectangleF.
public void FillRectangles(Brush brush, RectangleF[] rects)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
rects
RectangleF
[ ]
Array Aspose.Imaging.Rectangle struktury, które reprezentują rektangły do wypełnienia.
Exceptions
brush’ is null or
rects’ is null.
FillRegion(Brush, Region)
Wypełnia wnętrze Aspose.Imaging.Region.
public void FillRegion(Brush brush, Region region)
Parameters
brush
Brush
WL17_.Brush, który określa cechy wypełnienia.
region
Region
WL17_.Okręg reprezentujący obszar do wypełnienia.
Exceptions
brush’ is null.-or-
region’ is null.
~Graphics()
protected ~Graphics()
MeasureString(Źródło, StringFormat, SizeF)
Mierz określony pasek tekstowy za pomocą określonych parametrów
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameters
text
string
Tekst do pomiaru.
font
Font
Książka do pomiaru.
layoutArea
SizeF
w obszarze layout.
stringFormat
StringFormat
Format strunowy .
Returns
Rozmiar w pikselach mierzonej struny tekstowej
MultiplyTransform(Matrix)
Zwiększa się Aspose.Imaging.Matrix, który reprezentuje lokalną transformację geometryczną tego W L 17.Grafika przez określony _ W L 18_ .Matriks poprzez przedłożenie określonego _ w L 19_ ..
public void MultiplyTransform(Matrix matrix)
Parameters
matrix
Matrix
Materiał Aspose.Imaging.Matrix, przez który można pomnożyć transformację geometryczną.
MultiplyTransform(Matrix i MatrixOrder)
Multiplikuje Aspose.Imaging.Matrix, który reprezentuje lokalną transformację geometryczną tego __ WL16__ .Grafika przez określony wL19_.Matrix w określającym porządku.
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
Materiał Aspose.Imaging.Matrix, przez który można pomnożyć transformację geometryczną.
order
MatrixOrder
A Aspose.Imaging.MatrixOrder, który określa, w jakim celu pomnożyć dwie matryce.
ResetTransform()
Odtwarza Aspose.Imaging.Grafika.Transformacja własności na tożsamość.
public void ResetTransform()
RotateTransform(Floty)
Otocza lokalne transformacje geometryczne według określonej ilości. ta metoda przywiązuje rotację do transformacji.
public void RotateTransform(float angle)
Parameters
angle
float
Węgiel rotacji.
RotateTransform(Płytki, MatrixOrder)
Odwróci lokalną transformację geometryczną określoną ilością w określonym porządku.
public void RotateTransform(float angle, MatrixOrder order)
Parameters
angle
float
Węgiel rotacji.
order
MatrixOrder
A Aspose.Imaging.MatrixOrder, który określa, czy dodać lub przełączyć matrycę rotacyjną.
ScaleTransform(Floty, floty)
Skala lokalnej transformacji geometrycznej według określonych ilości. ta metoda przywiązuje matrycę skalowania do transformacji.
public void ScaleTransform(float sx, float sy)
Parameters
sx
float
Ilość, w której można skalić transformację w kierunku x-axis.
sy
float
Ilość, w której można skalić transformację w kierunku y-axis.
ScaleTransform(Float, Float i MatrixOrder)
Skala lokalnej transformacji geometrycznej według określonych ilości w określonym porządku.
public void ScaleTransform(float sx, float sy, MatrixOrder order)
Parameters
sx
float
Ilość, w której można skalić transformację w kierunku x-axis.
sy
float
Ilość, w której można skalić transformację w kierunku y-axis.
order
MatrixOrder
A Aspose.Imaging.MatrixOrder, który określa, czy do powiększania lub prepend matrycy skalowania.
TranslateTransform(Floty, floty)
Tłumaczy lokalną transformację geometryczną według określonych wymiarów. ta metoda przywiązuje tłumaczenie do transformacji.
public void TranslateTransform(float dx, float dy)
Parameters
dx
float
Wartość tłumaczenia w x.
dy
float
Wartość tłumaczenia w i.
TranslateTransform(Float, Float i MatrixOrder)
Tłumaczy lokalną transformację geometryczną według określonych wymiarów w określonym porządku.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
Wartość tłumaczenia w x.
dy
float
Wartość tłumaczenia w i.
order
MatrixOrder
Zamówienie (prepend lub append) w którym należy zastosować tłumaczenie.