Class Graphics

Class Graphics

Der Name: Aspose.Imaging Versammlung: Aspose.Imaging.dll (25.4.0)

Repräsentiert die Grafiken nach dem grafischen Motor, der in der aktuellen Sammlung verwendet wird.

public sealed class Graphics

Inheritance

object Graphics

Vererbte Mitglieder

object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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)

Initialisiert eine neue Instanz der Aspose.Imaging.Graphics Klasse.

public Graphics(Image sourceImage)

Parameters

sourceImage Image

Das Quellbild.

Properties

Clip

Erhalten oder setzen Sie die Clip-Region.

public Region Clip { get; set; }

Eigentumswert

Region

CompositingQuality

Er bekommt oder stellt die Kompositionqualität fest.

public CompositingQuality CompositingQuality { get; set; }

Eigentumswert

CompositingQuality

Dpix

Erhalten Sie die horizontale Auflösung dieser Aspose.Imaging.Graphics.

public float DpiX { get; }

Eigentumswert

float

Dpiy

Erhalten Sie die vertikale Auflösung dieses Aspose.Imaging.Graphics.

public float DpiY { get; }

Eigentumswert

float

Image

Er bekommt das Bild.

public Image Image { get; }

Eigentumswert

Image

InterpolationMode

Erhalten oder festlegen Sie den Interpolationsmodus.

public InterpolationMode InterpolationMode { get; set; }

Eigentumswert

InterpolationMode

IsInBeginUpdateCall

Er erhält einen Wert, der angibt, ob die Grafik im BeginUpdate Call-Status ist.

public bool IsInBeginUpdateCall { get; }

Eigentumswert

bool

PageScale

Erhalten oder setzen Sie die Skalierung zwischen Welt-Einheiten und Seiten-Einheiten für diese Aspose.Imaging.Graphics.

public float PageScale { get; set; }

Eigentumswert

float

PageUnit

Erhalten oder setzen Sie die für Seitenkoordinate verwendete Messseinheit in diesem Aspose.Imaging.Graphics.

public GraphicsUnit PageUnit { get; set; }

Eigentumswert

GraphicsUnit

PaintableImageOptions

Gibt oder setzt Bildoptionen, die verwendet werden, um malerbare Vakturbilder zu erstellen.

public ImageOptionsBase PaintableImageOptions { get; set; }

Eigentumswert

ImageOptionsBase

SmoothingMode

Erhalten oder setzen Sie den Schweißmodus.

public SmoothingMode SmoothingMode { get; set; }

Eigentumswert

SmoothingMode

TextRenderingHint

Gibt oder setzt den Text rendering Hinweis.

public TextRenderingHint TextRenderingHint { get; set; }

Eigentumswert

TextRenderingHint

Transform

Erhalten oder stellen Sie eine Kopie der geometrischen Welttransformation für diese Aspose.Imaging.Graphics.

public Matrix Transform { get; set; }

Eigentumswert

Matrix

Methods

BeginUpdate()

Die nachfolgenden grafischen Effekte werden nicht sofort angewendet, stattdessen wird die EndUpdate dazu führen, dass alle Effekte gleichzeitig angewendet werden.

public void BeginUpdate()

Remarks

Bitte beachten Sie, dass die Effekte nach BeginUpdate angerufen werden, werden nicht angewendet, wenn EndUpdate nicht angerufen wird.

Clear(Color)

Reinigen Sie die Grafikoberfläche mit der angegebenen Farbe.

public void Clear(Color color)

Parameters

color Color

Die Farbe, um die Grafikoberfläche durch zu reinigen.

Examples

Diese Beispiele verwenden die GraphicsPath und die Graphics-Klasse, um Figuren auf einer Bildoberfläche zu erstellen und zu manipulieren. Das Beispiel schafft eine neue Image (Typ Tiff), reinigt die Oberfläche und zieht Wege mit der Hilfe der GraphicsPath-Klasse. Am Ende wird die von Graphics-Klasse ausgesprochenen DrawPath-Methode dazu aufgefordert, die Wege auf der Oberfläche zu machen.

//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();
                                                                                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                                                                                             }

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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(Flotte, Flotte, Flotte, Flotte, Flotte, Flotte)

Sie dreht einen Lack, der einen Teil einer Ellipse darstellt, der durch ein Paar Koordinaten, eine Breite und eine Höhe angegeben ist.

public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Arc bestimmt.

x float

Der x-Koordinat des oberen linken Winkel des Rechteckens, der die Ellipse definiert.

y float

Der Y-Koordinat des oberen linken Ecks des Rechteckens, der die Ellipse definiert.

width float

Die Breite des Rechtangels, der die Ellipse definiert.

height float

Die Höhe des Rechteckens, der die Ellipse definiert.

startAngle float

Winkel in Grad gemessen Uhrwesen von der X-Axi bis zum Ausgangspunkt des Arc.

sweepAngle float

Angle in Graden gemessen Uhrwesen von der startAngle’ Parameter bis zum Ende der Punkt des Arcs.

Exceptions

ArgumentNullException

pen’ is null.

DrawArc(Pen, RectangleF, float, float)

Sie zieht einen Arc, der einen Teil eines Ellips darstellt, der durch eine Aspose.Imaging.RectangleF Struktur angegeben ist.

public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Arc bestimmt.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die die Grenzen der Ellipse definiert.

startAngle float

Winkel in Grad gemessen Uhrwesen von der X-Axi bis zum Ausgangspunkt des Arc.

sweepAngle float

Angle in Graden gemessen Uhrwesen von der startAngle’ Parameter bis zum Ende der Punkt des Arcs.

Exceptions

ArgumentNullException

pen’ is null

DrawArc(Pen, int, int, int, int, int, int)

Sie dreht einen Lack, der einen Teil einer Ellipse darstellt, der durch ein Paar Koordinaten, eine Breite und eine Höhe angegeben ist.

public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Arc bestimmt.

x int

Der x-Koordinat des oberen linken Winkel des Rechteckens, der die Ellipse definiert.

y int

Der Y-Koordinat des oberen linken Ecks des Rechteckens, der die Ellipse definiert.

width int

Die Breite des Rechtangels, der die Ellipse definiert.

height int

Die Höhe des Rechteckens, der die Ellipse definiert.

startAngle int

Winkel in Grad gemessen Uhrwesen von der X-Axi bis zum Ausgangspunkt des Arc.

sweepAngle int

Angle in Graden gemessen Uhrwesen von der startAngle’ Parameter bis zum Ende der Punkt des Arcs.

Exceptions

ArgumentNullException

pen’ is null.

DrawArc(Pen, Rectangle, Flut, Flut)

Drücken Sie einen Arc, der eine Portion einer Ellipse darstellt, die durch eine Aspose.Imaging.Rectangle Struktur angegeben ist.

public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Arc bestimmt.

rect Rectangle

Aspose.Imaging.RectangleF Struktur, die die Grenzen der Ellipse definiert.

startAngle float

Winkel in Grad gemessen Uhrwesen von der X-Axi bis zum Ausgangspunkt des Arc.

sweepAngle float

Angle in Graden gemessen Uhrwesen von der startAngle’ Parameter bis zum Ende der Punkt des Arcs.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawBezier(Flotte, Flotte, Flotte, Flotte, Flotte, Flotte, Flotte, Flotte)

Sie dreht eine Bézier-Spline, die durch vier bestellte Paare von Koordinaten definiert wird, die Punkte darstellen.

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, die die Farbe, Breite und Stil der Kurve bestimmen.

x1 float

Die X-Koordinate des Ausgangspunkts der Kurve.

y1 float

Der Y-Koordinat des Ausgangspunkts der Kurve.

x2 float

Der x-Koordinat des ersten Kontrollpunkts der Kurve.

y2 float

Der Y-Koordinat des ersten Kontrollpunkts der Kurve.

x3 float

Die X-Koordinate des zweiten Kontrollpunkts der Kurve.

y3 float

Der Y-Koordinat des zweiten Kontrollpunkts der Kurve.

x4 float

Die X-Koordinate des Endpunkts der Kurve.

y4 float

Der Y-Koordinat des Endpunkts der Kurve.

Exceptions

ArgumentNullException

pen’ is null.

DrawBezier(PointF, PointF, PointF und PointF)

Draws eine Bézier Spline definiert durch vier Aspose.Imaging.PointF Strukturen.

public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Kurve bestimmen.

pt1 PointF

Aspose.Imaging.PointF Struktur, die das Ausgangspunkt der Kurve darstellt.

pt2 PointF

Aspose.Imaging.PointF Struktur, die das erste Kontrollpunkt für die Kurve darstellt.

pt3 PointF

Aspose.Imaging.PointF Struktur, die das zweite Kontrollpunkt für die Kurve darstellt.

pt4 PointF

Aspose.Imaging.PointF Struktur, die das Endpunkt der Kurve darstellt.

Exceptions

ArgumentNullException

pen’ is null.

DrawBezier(Stück, Punkt, Punkt, Punkt)

Draws eine Bézier-Spline definiert durch vier Aspose.Imaging.Point-Strukturen.

public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)

Parameters

pen Pen

Aspose.Imaging.Pen Struktur, die die Farbe, Breite und Stil der Kurve bestimmt.

pt1 Point

Aspose.Imaging.Point-Struktur, die das Ausgangspunkt der Kurve darstellt.

pt2 Point

Aspose.Imaging.Point-Struktur, die das erste Kontrollpunkt für die Kurve darstellt.

pt3 Point

Aspose.Imaging.Point-Struktur, die das zweite Kontrollpunkt für die Kurve darstellt.

pt4 Point

Aspose.Imaging.Point-Struktur, die das Endpunkt der Kurve darstellt.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawBeziers(Stück, Punkt[])

Zeichnen Sie eine Reihe von Bézier Splines aus einer Reihe von Aspose.Imaging.Point Strukturen.

public void DrawBeziers(Pen pen, Point[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Kurve bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Punkte darstellen, die die Kurve bestimmen.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawBeziers(Stück, PointF[])

Zeichnen Sie eine Reihe von Bézier Splines aus einer Reihe von Aspose.Imaging.PointF Strukturen.

public void DrawBeziers(Pen pen, PointF[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Punkte darstellen, die die Kurve bestimmen.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawClosedCurve(Stück, PointF[])

Draws eine geschlossene Kardinalspline definiert durch eine Reihe von Aspose.Imaging.PointF Strukturen. Diese Methode verwendet eine Standardspannung von 0.5 und Aspose.Imaging.FillMode.Alternate Füllmodus.

public void DrawClosedCurve(Pen pen, PointF[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawClosedCurve(Stück, PointF[][], Die Flotte)

Drücken Sie eine geschlossene Kardinalspline, die durch eine Reihe von Aspose.Imaging.PointF Strukturen mit einer angegebenen Spannung definiert wird. Diese Methode verwendet einen standardmäßigen Aspose.Imaging.FillMode.Alternate Füllmodus.

public void DrawClosedCurve(Pen pen, PointF[] points, float tension)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawClosedCurve(Stück, Punkt[])

Draws eine geschlossene Kardinalspline definiert durch eine Reihe von Aspose.Imaging.Point Strukturen. Diese Methode verwendet eine Standardspannung von 0.5 und Aspose.Imaging.FillMode.Alternate Füllmodus.

public void DrawClosedCurve(Pen pen, Point[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawClosedCurve(Stück, Punkt[][], Die Flotte)

Drücken Sie eine geschlossene Kardinalspline, die durch eine Reihe von Aspose.Imaging.Point Strukturen mit einer angegebenen Spannung definiert wird. Diese Methode verwendet einen standardmäßigen Aspose.Imaging.FillMode.Alternate Füllmodus.

public void DrawClosedCurve(Pen pen, Point[] points, float tension)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, PointF[])

Draht eine Kardinalspline durch eine bestimmte Reihe von Aspose.Imaging.PointF Strukturen. Diese Methode verwendet eine Standardspannung von 0.5.

public void DrawCurve(Pen pen, PointF[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, PointF[][], Die Flotte)

Drücken Sie eine kardinale Spline durch eine bestimmte Reihe von Aspose.Imaging.PointF Strukturen mit einer bestimmten Spannung.

public void DrawCurve(Pen pen, PointF[] points, float tension)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Punkte darstellen, die die Kurve definieren.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, PointF[][], int , int)

Zeichnen Sie eine kardinale Spline durch eine bestimmte Reihe von Aspose.Imaging.PointF Strukturen. Die Zeichnung beginnt mit dem Beginn der Reihe.Diese Methode verwendet eine Standardspannung von 0.5.

public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

offset int

Absetzen Sie vom ersten Element in der Reihenfolge des points’ Parameter zum Ausgangspunkt in der Kurve.

numberOfSegments int

Anzahl der Segmente nach dem Ausgangspunkt, um in die Kurve aufzunehmen.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, PointF[][], int , int , float)

Drücken Sie eine Kardinalspline durch eine bestimmte Reihe von Aspose.Imaging.PointF Strukturen mit einer bestimmten Spannung.

public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

offset int

Absetzen Sie vom ersten Element in der Reihenfolge des points’ Parameter zum Ausgangspunkt in der Kurve.

numberOfSegments int

Anzahl der Segmente nach dem Ausgangspunkt, um in die Kurve aufzunehmen.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, Punkt[])

Drücken Sie eine kardinale Spline durch eine bestimmte Reihe von Aspose.Imaging.Point Strukturen.

public void DrawCurve(Pen pen, Point[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, Punkt[][], Die Flotte)

Drücken Sie eine Kardinalspline durch eine bestimmte Reihe von Aspose.Imaging.Point-Strukturen mit einer bestimmten Spannung.

public void DrawCurve(Pen pen, Point[] points, float tension)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawCurve(Stück, Punkt[][], int , int , float)

Drücken Sie eine Kardinalspline durch eine bestimmte Reihe von Aspose.Imaging.Point-Strukturen mit einer bestimmten Spannung.

public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Höhe der Kurve bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

offset int

Absetzen Sie vom ersten Element in der Reihenfolge des points’ Parameter zum Ausgangspunkt in der Kurve.

numberOfSegments int

Anzahl der Segmente nach dem Ausgangspunkt, um in die Kurve aufzunehmen.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawEllipse(Pen, RectangleF)

Entwickelt eine Ellipse, die durch eine Bindung Aspose.Imaging.RectangleF definiert wird.

public void DrawEllipse(Pen pen, RectangleF rect)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Ellipse bestimmen.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die die Grenzen der Ellipse definiert.

Exceptions

ArgumentNullException

pen’ is null.

DrawEllipse(Flotte, Flotte, Flotte, Flotte und Flotte)

Es dreht eine Ellipse, die durch eine Grenzrechte definiert wird, die durch ein Paar Koordinaten, eine Höhe und eine Breite angegeben ist.

public void DrawEllipse(Pen pen, float x, float y, float width, float height)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Ellipse bestimmen.

x float

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

y float

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

width float

Die Breite des Grenzrechts, der die Ellipse definiert.

height float

Die Höhe des Grenzrechts, der die Ellipse definiert.

Exceptions

ArgumentNullException

pen’ is null.

DrawEllipse(Pen und Rectangle)

Draht eine Ellipse, die durch eine Grenzstruktur von Aspose.Imaging.Rectangle angegeben wird.

public void DrawEllipse(Pen pen, Rectangle rect)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Ellipse bestimmen.

rect Rectangle

Aspose.Imaging.Rectangle Struktur, die die Grenzen der Ellipse definiert.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawEllipse(Pen, int, int, int, int)

Es dreht eine Ellipse, die durch eine Grenzrechte definiert wird, die durch ein Paar Koordinaten, eine Höhe und eine Breite angegeben ist.

public void DrawEllipse(Pen pen, int x, int y, int width, int height)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Ellipse bestimmen.

x int

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

y int

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

width int

Die Breite des Grenzrechts, der die Ellipse definiert.

height int

Die Höhe des Grenzrechts, der die Ellipse definiert.

Exceptions

ArgumentNullException

pen’ is null.

DrawImage(Bilder von PointF)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image, mit seiner ursprünglichen physischen Größe, an der angegebenen Stelle.

public void DrawImage(Image sourceImage, PointF point)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

point PointF

Aspose.Imaging.PointF Struktur, die den oberen linken Winkel des entworfenen Bildes darstellt.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Flotte und Flotte)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image, mit seiner ursprünglichen physischen Größe, an der angegebenen Stelle.

public void DrawImage(Image sourceImage, float x, float y)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

x float

Die x-Koordinate des oberen linken Ecks des entworfenen Bildes.

y float

Der y-Koordinat des oberen linken Winkel des entworfenen Bildes.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, RectangleF)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, RectangleF rect)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die die Lage und Größe des entworfenen Bildes angibt.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Rectangle, GraphicsUnit)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectDestination Rectangle

Der Zielrechteck.

graphicsUnit GraphicsUnit

Die Graphic Unit.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, RectangleF, GraphicsUnit)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectDestination RectangleF

Der Zielrechteck.

graphicsUnit GraphicsUnit

Die Graphic Unit.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Rectangle, GraphicsUnit, ImageAttributes)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectDestination Rectangle

Der Zielrechteck.

graphicsUnit GraphicsUnit

Die Graphic Unit.

imageAttributes ImageAttributes

Das Bild hat Attribute.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, RectangleF, GraphicsUnit, ImageAttributes)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectDestination RectangleF

Der Zielrechtsangel zu ziehen.

graphicsUnit GraphicsUnit

Die Graphic Unit.

imageAttributes ImageAttributes

Das Bild hat Attribute.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Rectangle, Rectangle, Grafiken)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectSource Rectangle

Die rechte Quelle.

rectDestination Rectangle

Der rechte Reiseziel.

graphicsUnit GraphicsUnit

Die Graphic Unit.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, RectangleF, RectangleF, GraphicsUnit)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectSource RectangleF

Die rechte Quelle.

rectDestination RectangleF

Der rechte Reiseziel.

graphicsUnit GraphicsUnit

Die Graphic Unit.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Rectangle, Rectangle, GraphicsUnit, ImageAttributes)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectSource Rectangle

Die rechte Quelle.

rectDestination Rectangle

Der rechte Reiseziel.

graphicsUnit GraphicsUnit

Die Graphic Unit.

imageAttributes ImageAttributes

Das Bild hat Attribute.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, RectangleF, RectangleF, GraphicsUnit, ImageAttributes)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rectSource RectangleF

Der Quellrechteck.

rectDestination RectangleF

Der Zielrechteck.

graphicsUnit GraphicsUnit

Die grafische Einheit zu verwenden.

imageAttributes ImageAttributes

Das Bild eignet sich für die Verwendung.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Punkt[])

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, Point[] destPoints)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints Point [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

DrawImage(Bild, Punkt[][], und Rectangle)

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints Point [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

srcRect Rectangle

Der Quellrechteck.

DrawImage(Bild, Punkt[][], Rectangle, GraphicsUnit)

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints Point [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

srcRect Rectangle

Der Quellrechteck.

srcUnit GraphicsUnit

Die Einheiten der Messung.

DrawImage(Bild, Punkt[][], Rectangle, GraphicsUnit, ImageAttributes)

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints Point [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

srcRect Rectangle

Der Quellrechteck.

srcUnit GraphicsUnit

Die Einheiten der Messung.

imageAttributes ImageAttributes

Das Bild hat Attribute.

DrawImage(Bilder von PointF[])

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, PointF[] destPoints)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints PointF [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

Exceptions

ArgumentNullException

Bild

DrawImage(Bilder von PointF[][], und RectangleF)

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints PointF [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

srcRect RectangleF

Der Quellrechteck.

DrawImage(Bilder von PointF[][], RectangleF, GraphicsUnit)

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints PointF [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

srcRect RectangleF

Der Quellrechteck.

srcUnit GraphicsUnit

Die Einheiten der Messung.

DrawImage(Bilder von PointF[][], RectangleF, GraphicsUnit, ImageAttributes)

Zeichnen Sie den angegebenen Teil der angegebenen image’ an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)

Parameters

image Image

Das Bild zum Zeichnen.

destPoints PointF [][]

Eine Reihe von drei PointF-Strukturen, die ein Parallelogram definieren.

srcRect RectangleF

Der Quellrechteck.

srcUnit GraphicsUnit

Die Einheiten der Messung.

imageAttributes ImageAttributes

Das Bild hat Attribute.

DrawImage(Bild, Flotte, Flotte, Flotte, Flotte)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, float x, float y, float width, float height)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

x float

Die x-Koordinate des oberen linken Ecks des entworfenen Bildes.

y float

Der y-Koordinat des oberen linken Winkel des entworfenen Bildes.

width float

Die Breite des gezeichneten Bildes.

height float

Die Höhe des gezeichneten Bildes.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Punkt)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image, mit seiner ursprünglichen physischen Größe, an der angegebenen Stelle.

public void DrawImage(Image sourceImage, Point point)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

point Point

Aspose.Imaging.Point-Struktur, die die Lage der oberen linken Ecke des entworfenen Bildes darstellt.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, int, int)

Zeichnen Sie das angegebenen Bild, mit seiner ursprünglichen physischen Größe, an der von einem Koordinatenpaar angegebenen Lage.

public void DrawImage(Image sourceImage, int x, int y)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

x int

Die x-Koordinate des oberen linken Ecks des entworfenen Bildes.

y int

Der y-Koordinat des oberen linken Winkel des entworfenen Bildes.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, Rectangle)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rect Rectangle

Aspose.Imaging.Rectangle Struktur, die die Lage und Größe des entworfenen Bildes angibt.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Bild, int, int, int, int)

Zeichnen Sie die angegebenen Aspose.Imaging.Graphics.Image an der angegebenen Lage und mit der angegebenen Größe.

public void DrawImage(Image sourceImage, int x, int y, int width, int height)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

x int

Die x-Koordinate des oberen linken Ecks des entworfenen Bildes.

y int

Der y-Koordinat des oberen linken Winkel des entworfenen Bildes.

width int

Die Breite des gezeichneten Bildes.

height int

Die Höhe des gezeichneten Bildes.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Bild, Punkt)

Zeichnen Sie ein bestimmtes Bild mit seiner ursprünglichen physischen Größe an einem bestimmten Standort.

public void DrawImageUnscaled(Image sourceImage, Point point)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

point Point

Aspose.Imaging.Point-Struktur, die den oberen linken Winkel des entworfenen Bildes angibt.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Bild, int, int)

Zeichnen Sie das angegebenes Bild mit seiner ursprünglichen physischen Größe an der von einem Koordinatenpaar angegebenen Lage.

public void DrawImageUnscaled(Image sourceImage, int x, int y)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

x int

Die x-Koordinate des oberen linken Ecks des entworfenen Bildes.

y int

Der y-Koordinat des oberen linken Winkel des entworfenen Bildes.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Bild, Rectangle)

Zeichnen Sie ein bestimmtes Bild mit seiner ursprünglichen physischen Größe an einem bestimmten Standort.

public void DrawImageUnscaled(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rect Rectangle

Aspose.Imaging.Rectangle, die den oberen linken Winkel des gezeichneten Bildes spezifiziert.Die Eigenschaften von X und Y des rektangels spezifizieren den oberen linken Winkel. Die Eigenschaften von Breite und Höhe werden ignoriert.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Bild, int, int, int, int)

Zeichnen Sie ein bestimmtes Bild mit seiner ursprünglichen physischen Größe an einem bestimmten Standort.

public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

x int

Die x-Koordinate des oberen linken Ecks des entworfenen Bildes.

y int

Der y-Koordinat des oberen linken Winkel des entworfenen Bildes.

width int

Der Parameter wird nicht verwendet.

height int

Der Parameter wird nicht verwendet.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaledAndClipped(Bild, Rectangle)

Zeichnen Sie das angegebenes Bild ohne Skalierung und klicken Sie es, falls erforderlich, in den angegebenen Rechteck zu passen.

public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Das Bild, mit dem man zieht.

rect Rectangle

Der Aspose.Imaging.Rectangle, in dem man das Bild zieht.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawLine(Stück, Punkt und Punkt)

Zeige eine Linie, die zwei Aspose.Imaging.Point-Strukturen verbindet.

public void DrawLine(Pen pen, Point point1, Point point2)

Parameters

pen Pen

Aspose.Imaging.Pen, das die Farbe, Breite und Stil der Linie bestimmt.

point1 Point

Aspose.Imaging.Point-Struktur, die das erste Punkt darstellt, um zu verbinden.

point2 Point

Aspose.Imaging.Point Struktur, die das zweite Punkt zu verbinden darstellt.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawLine(Pension, PointF und PointF)

Zeichnen Sie eine Linie, die zwei Aspose.Imaging.PointF Strukturen verbindet.

public void DrawLine(Pen pen, PointF point1, PointF point2)

Parameters

pen Pen

Aspose.Imaging.Pen, das die Farbe, Breite und Stil der Linie bestimmt.

point1 PointF

Aspose.Imaging.PointF Struktur, die das erste Punkt zu verbinden darstellt.

point2 PointF

Aspose.Imaging.PointF Struktur, die das zweite Punkt zu verbinden darstellt.

Exceptions

ArgumentNullException

pen’ is null.

DrawLine(Pen, int, int, int, int)

Zeige eine Linie, die die zwei Punkte verbindet, die von den Koordinatenpaaren angegeben werden.

public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)

Parameters

pen Pen

Aspose.Imaging.Pen, das die Farbe, Breite und Stil der Linie bestimmt.

x1 int

Die X-Koordinate des ersten Punkts.

y1 int

Die Y-Koordinate des ersten Punkts.

x2 int

Die X-Koordinate des zweiten Punkts.

y2 int

Die Y-Koordinate des zweiten Punkts.

Exceptions

ArgumentNullException

pen’ is null.

DrawLine(Flotte, Flotte, Flotte, Flotte und Flotte)

Zeige eine Linie, die die zwei Punkte verbindet, die von den Koordinatenpaaren angegeben werden.

public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)

Parameters

pen Pen

Aspose.Imaging.Pen, das die Farbe, Breite und Stil der Linie bestimmt.

x1 float

Die X-Koordinate des ersten Punkts.

y1 float

Die Y-Koordinate des ersten Punkts.

x2 float

Die X-Koordinate des zweiten Punkts.

y2 float

Die Y-Koordinate des zweiten Punkts.

Exceptions

ArgumentNullException

pen’ is null.

DrawLines(Stück, Punkt[])

Zeichnen Sie eine Reihe von Zeilenegmenten, die eine Reihe von Aspose.Imaging.Point-Strukturen verbinden.

public void DrawLines(Pen pen, Point[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Zeilenegmente bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Punkte darstellen, die zu verbinden sind.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

ArgumentException

Das points’ Array enthält weniger als 2 Punkte.

DrawLines(Stück, PointF[])

Zeichnen Sie eine Reihe von Zeilenegmenten, die eine Reihe von Aspose.Imaging.PointF Strukturen verbinden.

public void DrawLines(Pen pen, PointF[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Zeilenegmente bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Punkte zu verbinden darstellen.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

ArgumentException

Das points’ Array enthält weniger als 2 Punkte.

DrawPath(Pen und GraphicsPath)

Entwickeln Sie eine Aspose.Imaging.GraphicsPath.

public void DrawPath(Pen pen, GraphicsPath path)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Weges bestimmen.

path GraphicsPath

Aspose.Imaging.GraphicsPath zum Zeichnen.

Examples

Diese Beispiele verwenden die GraphicsPath und die Graphics-Klasse, um Figuren auf einer Bildoberfläche zu erstellen und zu manipulieren. Das Beispiel schafft eine neue Image (Typ Tiff), reinigt die Oberfläche und zieht Wege mit der Hilfe der GraphicsPath-Klasse. Am Ende wird die von Graphics-Klasse ausgesprochenen DrawPath-Methode dazu aufgefordert, die Wege auf der Oberfläche zu machen.

//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

ArgumentNullException

pen’ is null.-or-path’ is null.

DrawPie(Pen, RectangleF, float, float)

Zeichnen Sie eine von einer Aspose.Imaging.RectangleF Struktur und zwei radialen Linien angegebenen Ellipse.

public void DrawPie(Pen pen, RectangleF rect, float startAngle, float sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Pie Form bestimmen.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die den Bindungsrechtsangel darstellt, der die Ellipse definiert, aus der die Feuerform stammt.

startAngle float

Winkel gemessen in Grad klockwesen von der x-axis bis zur ersten Seite der pie-form.

sweepAngle float

Angle gemessen in Gradklockwesen von der startAngle’ Parameter auf die zweite Seite der Pie-Form.

Exceptions

ArgumentNullException

pen’ is null.

DrawPie(Flotte, Flotte, Flotte, Flotte, Flotte, Flotte)

Zeichnen Sie eine Pie-Form, die durch eine Ellipse definiert wird, die durch ein Koordinatenpaar, eine Breite, eine Höhe und zwei Radiallinien angegeben wird.

public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Pie Form bestimmen.

x float

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der die Pie-Form kommt.

y float

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der die Farbe kommt.

width float

Die Breite des Grenzrechts, der die Ellipse definiert, aus der die Pie-Form kommt.

height float

Die Höhe des Grenzrechts, der die Ellipse definiert, aus der die Pie-Form kommt.

startAngle float

Winkel gemessen in Grad klockwesen von der x-axis bis zur ersten Seite der pie-form.

sweepAngle float

Angle gemessen in Gradklockwesen von der startAngle’ Parameter auf die zweite Seite der Pie-Form.

Exceptions

ArgumentNullException

pen’ is null.

DrawPie(Pen, Rectangle, Flut, Flut)

Zeichnen Sie eine von einer Aspose.Imaging.Rectangle Struktur und zwei radialen Linien angegebenen Ellipse.

public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Pie Form bestimmen.

rect Rectangle

Aspose.Imaging.Rectangle Struktur, die den Bindungsrechtsangel darstellt, der die Ellipse definiert, aus der die Pie-Form kommt.

startAngle float

Winkel gemessen in Grad klockwesen von der x-axis bis zur ersten Seite der pie-form.

sweepAngle float

Angle gemessen in Gradklockwesen von der startAngle’ Parameter auf die zweite Seite der Pie-Form.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawPie(Pen, int, int, int, int, int, int)

Zeichnen Sie eine Pie-Form, die durch eine Ellipse definiert wird, die durch ein Koordinatenpaar, eine Breite, eine Höhe und zwei Radiallinien angegeben wird.

public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Pie Form bestimmen.

x int

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der die Pie-Form kommt.

y int

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der die Farbe kommt.

width int

Die Breite des Grenzrechts, der die Ellipse definiert, aus der die Pie-Form kommt.

height int

Die Höhe des Grenzrechts, der die Ellipse definiert, aus der die Pie-Form kommt.

startAngle int

Winkel gemessen in Grad klockwesen von der x-axis bis zur ersten Seite der pie-form.

sweepAngle int

Angle gemessen in Gradklockwesen von der startAngle’ Parameter auf die zweite Seite der Pie-Form.

Exceptions

ArgumentNullException

pen’ is null.

DrawPolygon(Stück, PointF[])

Draht ein Polygon, das durch eine Reihe von Aspose.Imaging.PointF Strukturen definiert wird.

public void DrawPolygon(Pen pen, PointF[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Polygons bestimmen.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Vertikale des Polygons darstellen.

Exceptions

ArgumentNullException

pen’ is null.-or-points’ is null.

DrawPolygon(Stück, Punkt[])

Draht einen Polygon, der durch eine Reihe von Aspose.Imaging.Point-Strukturen definiert wird.

public void DrawPolygon(Pen pen, Point[] points)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Polygons bestimmen.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Vertikale des Polygons darstellen.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawRectangle(Pen, RectangleF)

Draht eine rechte Ecke, die durch eine Aspose.Imaging.RectangleF Struktur angegeben wird.

public void DrawRectangle(Pen pen, RectangleF rect)

Parameters

pen Pen

Ein Aspose.Imaging.Pen, der die Farbe, Breite und Stil des Rechteckens bestimmt.

rect RectangleF

Eine Aspose.Imaging.RectangleF Struktur, die den Rechtangel darstellt.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangle(Pen und Rectangle)

Draht eine rechte Ecke, die durch eine Aspose.Imaging.Rectangle Struktur angegeben wird.

public void DrawRectangle(Pen pen, Rectangle rect)

Parameters

pen Pen

Ein Aspose.Imaging.Pen, der die Farbe, Breite und Stil des Rechteckens bestimmt.

rect Rectangle

Eine Aspose.Imaging.Rectangle Struktur, die die rechte Ecke darstellt.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

pen’ is null.

DrawRectangle(Flotte, Flotte, Flotte, Flotte und Flotte)

Draht eine rechte Ecke, die von einem Koordinatenpaar, einer Breite und einer Höhe angegeben wird.

public void DrawRectangle(Pen pen, float x, float y, float width, float height)

Parameters

pen Pen

Ein Aspose.Imaging.Pen, der die Farbe, Breite und Stil des Rechteckens bestimmt.

x float

Die x-Koordinate des oberen linken Ecks des Rechteckens zum Zeichnen.

y float

Der Y-Koordinat des oberen linken Winkel des Rechteckens zum Zeichnen.

width float

Die Breite des Rechteckens zum Zeichnen.

height float

Die Höhe des Rechteckens zum Zeichnen.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangle(Pen, int, int, int, int)

Draht eine rechte Ecke, die von einem Koordinatenpaar, einer Breite und einer Höhe angegeben wird.

public void DrawRectangle(Pen pen, int x, int y, int width, int height)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil des Rechteckens bestimmen.

x int

Die x-Koordinate des oberen linken Ecks des Rechteckens zum Zeichnen.

y int

Der Y-Koordinat des oberen linken Winkel des Rechteckens zum Zeichnen.

width int

Die Breite des Rechtangels zum Zeichnen.

height int

Die Höhe des Rechteckens zum Zeichnen.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangles(Pen, RectangleF[])

Zeichnen Sie eine Reihe von rektangeln, die durch Aspose.Imaging.RectangleF Strukturen angegeben sind.

public void DrawRectangles(Pen pen, RectangleF[] rects)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Auslinien der Rechtecken bestimmen.

rects RectangleF [][]

Eine Reihe von Aspose.Imaging.RectangleF Strukturen, die die rechte Ecke darstellen.

Exceptions

ArgumentNullException

pen’ is null.-or-rects’ is null.

DrawRectangles(Pen und Rectangle[])

Zeichnen Sie eine Reihe von rektangeln, die durch Aspose.Imaging.Rectangle Strukturen angegeben werden.

public void DrawRectangles(Pen pen, Rectangle[] rects)

Parameters

pen Pen

Aspose.Imaging.Pen, die die Farbe, Breite und Stil der Auslinien der Rechtecken bestimmen.

rects Rectangle [][]

Eine Reihe von Aspose.Imaging.Rectangle Strukturen, die die Rechtangeln darstellen.

Examples

Dieses Beispiel zeigt die Erstellung und Verwendung von Pen-Objekten. Das Beispiel schafft ein neues Bild und zeichnet Rectangles auf der Bildoberfläche.

//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

ArgumentNullException

pen’ is null.-or-rects’ is null.

DrawString(String, Font, Brush, Float, Float)

Drücken Sie die angegebenen Textrad an der angegebenen Stelle mit den angegebenen Aspose.Imaging.Brush und Aspose.Imaging.Font Objekten.

public void DrawString(string s, Font font, Brush brush, float x, float y)

Parameters

s string

String zum Zeichnen.

font Font

Aspose.Imaging.Font, das das Textformat der Zeile definiert.

brush Brush

Aspose.Imaging.Brush, die die Farbe und Textur des getragenen Textes bestimmen.

x float

Die x-Koordinate des oberen linken Winkel des getragenen Textes.

y float

Der y-Koordinat des oberen linken Winkel des getragenen Textes.

Exceptions

ArgumentNullException

brush’ is null.-or-s’ is null.

DrawString(String, Font, Brush und PointF)

Drücken Sie die angegebenen Textrad an der angegebenen Stelle mit den angegebenen Aspose.Imaging.Brush und Aspose.Imaging.Font Objekten.

public void DrawString(string s, Font font, Brush brush, PointF point)

Parameters

s string

String zum Zeichnen.

font Font

Aspose.Imaging.Font, das das Textformat der Zeile definiert.

brush Brush

Aspose.Imaging.Brush, die die Farbe und Textur des getragenen Textes bestimmen.

point PointF

Aspose.Imaging.PointF Struktur, die den oberen linken Winkel des getragenen Textes angibt.

Examples

Dieses Beispiel verwendet die Graphics-Klasse, um primitive Formen auf der Bildoberfläche zu erstellen.Um die Operation zu demonstrieren, schafft das Beispiel ein neues Bild in PNG-Format und zeichnet primitive Formen auf der Bildoberfläche mit den von Graphics-Klasse ausgesprochenen Zeichnen-Methoden

//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

ArgumentNullException

brush’ is null.-or-s’ is null.

DrawString(String, Font, Brush, Float, Float, StringFormat)

Drücken Sie die angegebenen Textrad an der angegebenen Stelle mit den angegebenen Aspose.Imaging.Brush und Aspose.Imaging.Font Objekten mit den Formatierungsattributen der angegebenen Aspose.Imaging.StringFormat.

public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format)

Parameters

s string

String zum Zeichnen.

font Font

Aspose.Imaging.Font, das das Textformat der Zeile definiert.

brush Brush

Aspose.Imaging.Brush, die die Farbe und Textur des getragenen Textes bestimmen.

x float

Die x-Koordinate des oberen linken Winkel des getragenen Textes.

y float

Der y-Koordinat des oberen linken Winkel des getragenen Textes.

format StringFormat

Aspose.Imaging.StringFormat, das Formatierungsattribute wie Line Spacing und Alignment spezifiziert, die auf den entworfenen Text angewendet werden.

Exceptions

ArgumentNullException

brush’ is null.-or-s’ is null.

DrawString(String, Font, Brush, PointF, StringFormat)

Drücken Sie die angegebenen Textrad an der angegebenen Stelle mit den angegebenen Aspose.Imaging.Brush und Aspose.Imaging.Font Objekten mit den Formatierungsattributen der angegebenen Aspose.Imaging.StringFormat.

public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)

Parameters

s string

String zum Zeichnen.

font Font

Aspose.Imaging.Font, das das Textformat der Zeile definiert.

brush Brush

Aspose.Imaging.Brush, die die Farbe und Textur des getragenen Textes bestimmen.

point PointF

Aspose.Imaging.PointF Struktur, die den oberen linken Winkel des getragenen Textes angibt.

format StringFormat

Aspose.Imaging.StringFormat, das Formatierungsattribute wie Line Spacing und Alignment spezifiziert, die auf den entworfenen Text angewendet werden.

Exceptions

ArgumentNullException

brush’ is null.-or-s’ is null.

DrawString(String, Font, Brush, RectangleF)

Drücken Sie die angegebenen Textrad in der angegebenen Rechteck mit den angegebenen Aspose.Imaging.Brush und Aspose.Imaging.Font Objekten.

public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)

Parameters

s string

String zum Zeichnen.

font Font

Aspose.Imaging.Font, das das Textformat der Zeile definiert.

brush Brush

Aspose.Imaging.Brush, die die Farbe und Textur des getragenen Textes bestimmen.

layoutRectangle RectangleF

Aspose.Imaging.RectangleF Struktur, die den Standort des getragenen Textes angibt.

Exceptions

ArgumentNullException

brush’ is null.-or-s’ is null.

DrawString(String, Font, Brush, RectangleF, StringFormat)

Drücken Sie die angegebenen Textrad in der angegebenen Rechteck mit den angegebenen Aspose.Imaging.Brush und Aspose.Imaging.Font Objekte mit den Formatierungsattributen der angegebenen Aspose.Imaging.StringFormat.

public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)

Parameters

s string

String zum Zeichnen.

font Font

Aspose.Imaging.Font, das das Textformat der Zeile definiert.

brush Brush

Aspose.Imaging.Brush, die die Farbe und Textur des getragenen Textes bestimmen.

layoutRectangle RectangleF

Aspose.Imaging.RectangleF Struktur, die den Standort des getragenen Textes angibt.

format StringFormat

Aspose.Imaging.StringFormat, das Formatierungsattribute wie Line Spacing und Alignment spezifiziert, die auf den entworfenen Text angewendet werden.

Exceptions

ArgumentNullException

brush’ is null.-or-s’ is null.-or-brush’ is null.

EndUpdate()

Das Caching der grafischen Operationen beginnt, nachdem BeginUpdate angerufen wurde. Die vorhergehenden grafischen Operationen werden gleichzeitig angewendet, wenn diese Methode angerufen wird.

public void EndUpdate()

FillClosedCurve(Brush und PointF[])

Fülle das Innere einer geschlossenen Kardinalspline Kurve definiert durch eine Reihe von Aspose.Imaging.PointF Strukturen. Diese Methode verwendet eine Standardspannung von 0.5 und Aspose.Imaging.FillMode.Alternate Füllmodus.

public void FillClosedCurve(Brush brush, PointF[] points)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillClosedCurve(Brush und PointF[][], und FillMode)

Fülle das Innere einer geschlossenen Kardinalspline Curve definiert durch eine Reihe von Aspose.Imaging.PointF Strukturen mit dem angegebenen Füllmodus. Diese Methode verwendet eine Standardspannung von 0.5.

public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillMode)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

fillMode FillMode

Mitglied der Aspose.Imaging.FillMode Liste, die bestimmt, wie die Kurve gefüllt wird.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillClosedCurve(Brush und PointF[][], FillMode , Float)

Füllt das Innere einer geschlossenen Kardinalspline-Kurve, die durch eine Reihe von Aspose.Imaging.PointF-Strukturen mit dem angegebenen Füllmodus und Spannung definiert wird.

public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)

Parameters

brush Brush

Eine Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spline definieren.

fillmode FillMode

Mitglied der Aspose.Imaging.FillMode Liste, die bestimmt, wie die Kurve gefüllt wird.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillClosedCurve(Brush, Punkt[])

Fülle das Innere einer geschlossenen Kardinalspline Kurve definiert durch eine Reihe von Aspose.Imaging.Point Strukturen. Diese Methode verwendet eine Standardspannung von 0.5 und Aspose.Imaging.FillMode.Alternate Füllmodus.

public void FillClosedCurve(Brush brush, Point[] points)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillClosedCurve(Brush, Punkt[][], und FillMode)

Füllt das Innere einer geschlossenen Kardinalspline Kurve, die durch eine Reihe von Aspose.Imaging.Point-Strukturen mit dem angegebenen Füllmodus definiert wird.

public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

fillmode FillMode

Mitglied der Aspose.Imaging.FillMode Liste, die bestimmt, wie die Kurve gefüllt wird.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillClosedCurve(Brush, Punkt[][], FillMode , Float)

Füllt das Innere einer geschlossenen Kardinalspline-Kurve, die durch eine Reihe von Aspose.Imaging.Point-Strukturen mit dem angegebenen Füllmodus und Spannung definiert wird.

public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode, float tension)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spline definieren.

fillmode FillMode

Mitglied der Aspose.Imaging.FillMode Liste, die bestimmt, wie die Kurve gefüllt wird.

tension float

Wert größer oder gleich 0,0F, die die Spannung der Kurve angibt.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillEllipse(Brush und RectangleF)

Fülle das Innere einer Ellipse, die durch einen von einer Aspose.Imaging.RectangleF Struktur angegebenen Bindungsrechtangel definiert wird.

public void FillEllipse(Brush brush, RectangleF rect)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die den Bindungsrechtsangel darstellt, der die Ellipse definiert.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Brush, float, float, float, float)

Fülle das Innere einer Ellipse, die durch einen Grenzrechtsangel definiert wird, der durch ein Paar Koordinaten, eine Breite und eine Höhe angegeben wird.

public void FillEllipse(Brush brush, float x, float y, float width, float height)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

x float

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

y float

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

width float

Die Breite des Grenzrechts, der die Ellipse definiert.

height float

Die Höhe des Grenzrechts, der die Ellipse definiert.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Brush und Rectangle)

Fülle das Innere einer Ellipse, die durch einen von einer Aspose.Imaging.Rectangle Struktur angegebenen Bindungsrechtangel definiert wird.

public void FillEllipse(Brush brush, Rectangle rect)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rect Rectangle

Aspose.Imaging.Rectangle Struktur, die den Bindungsrechtsangel darstellt, der die Ellipse definiert.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Brush, int, int, int, int)

Fülle das Innere einer Ellipse, die durch einen Grenzrechtsangel definiert wird, der durch ein Paar Koordinaten, eine Breite und eine Höhe angegeben wird.

public void FillEllipse(Brush brush, int x, int y, int width, int height)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

x int

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

y int

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert.

width int

Die Breite des Grenzrechts, der die Ellipse definiert.

height int

Die Höhe des Grenzrechts, der die Ellipse definiert.

Exceptions

ArgumentNullException

brush’ is null.

FillPath(Brush und GraphicsPath)

Fülle das Innere eines Aspose.Imaging.GraphicsPath.

public void FillPath(Brush brush, GraphicsPath path)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

path GraphicsPath

Aspose.Imaging.GraphicsPath, der den Weg darstellt, um zu füllen.

Exceptions

ArgumentNullException

brush’ is null.-or-path’ is null.

FillPie(Brush, Rectangle, Flut, Flut)

Füllt das Innere eines Pie-Abschnitts, das durch eine Ellipse definiert wird, die durch eine Aspose.Imaging.RectangleF Struktur und zwei Radiallinien angegeben ist.

public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rect Rectangle

Aspose.Imaging.Rectangle Struktur, die den Bindungsrechtsangel darstellt, der die Ellipse definiert, aus der die Pie-Sektion kommt.

startAngle float

Winkel in Grad gemessen klockwesen von der x-axis auf die erste Seite der pie-Sektion.

sweepAngle float

Angle in Grad gemessen Uhrwesen von der startAngle’ Parameter auf der zweiten Seite des Pie-Abschnitts.

Examples

Das folgende Beispiel zeigt, wie man ein animiertes GIF-Bild aus einzelnen GIF-Blocken komponiert.

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

ArgumentNullException

brush’ is null.

FillPie(Brush, RectangleF, float, float)

Füllt das Innere eines Pie-Abschnitts, das durch eine Ellipse definiert wird, die durch eine Aspose.Imaging.RectangleF Struktur und zwei Radiallinien angegeben ist.

public void FillPie(Brush brush, RectangleF rect, float startAngle, float sweepAngle)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die den Bindungsrechtsangel darstellt, der die Ellipse definiert, aus der die Pie-Sektion kommt.

startAngle float

Winkel in Grad gemessen klockwesen von der x-axis auf die erste Seite der pie-Sektion.

sweepAngle float

Angle in Grad gemessen Uhrwesen von der startAngle’ Parameter auf der zweiten Seite des Pie-Abschnitts.

Exceptions

ArgumentNullException

brush’ is null.

FillPie(Brush, Flotte, Flotte, Flotte, Flotte, Flotte, Flotte)

Fülle das Innere eines Pie-Abschnitts, definiert durch eine Ellipse, die durch ein Paar Koordinaten, eine Breite, eine Höhe und zwei Radiallinien angegeben wird.

public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

x float

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der der Pie-Sektion kommt.

y float

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der der Pie-Sektion kommt.

width float

Die Breite des Grenzrechts, der die Ellipse definiert, aus der die Pie-Sektion kommt.

height float

Die Höhe des Grenzrechts, der die Ellipse definiert, aus der die Pie-Sektion kommt.

startAngle float

Winkel in Grad gemessen klockwesen von der x-axis auf die erste Seite der pie-Sektion.

sweepAngle float

Angle in Grad gemessen Uhrwesen von der startAngle’ Parameter auf der zweiten Seite des Pie-Abschnitts.

Exceptions

ArgumentNullException

brush’ is null.

FillPie(Brush, int, int, int, int, int, int)

Fülle das Innere eines Pie-Abschnitts, definiert durch eine Ellipse, die durch ein Paar Koordinaten, eine Breite, eine Höhe und zwei Radiallinien angegeben wird.

public void FillPie(Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

x int

Der x-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der der Pie-Sektion kommt.

y int

Der Y-Koordinat des oberen linken Winkel des Bindungsrechts, der die Ellipse definiert, aus der der Pie-Sektion kommt.

width int

Die Breite des Grenzrechts, der die Ellipse definiert, aus der die Pie-Sektion kommt.

height int

Die Höhe des Grenzrechts, der die Ellipse definiert, aus der die Pie-Sektion kommt.

startAngle int

Winkel in Grad gemessen klockwesen von der x-axis auf die erste Seite der pie-Sektion.

sweepAngle int

Angle in Grad gemessen Uhrwesen von der startAngle’ Parameter auf der zweiten Seite des Pie-Abschnitts.

Exceptions

ArgumentNullException

brush’ is null.

FillPolygon(Brush und PointF[])

Fülle das Innere eines Polygons, das durch eine Reihe von Punkten definiert wird, die durch Aspose.Imaging.PointF Strukturen und Aspose.Imaging.FillMode.Alternate angegeben sind.

public void FillPolygon(Brush brush, PointF[] points)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spitzen des Polygons darstellen, um zu füllen.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillPolygon(Brush und PointF[][], und FillMode)

Füllt das Innere eines Polygons, das durch eine Reihe von Punkten definiert wird, die durch Aspose.Imaging.PointF Strukturen mit dem angegebenen Füllmodus angegeben werden.

public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points PointF [][]

Eine Reihe von Aspose.Imaging.PointF Strukturen, die die Spitzen des Polygons darstellen, um zu füllen.

fillMode FillMode

Mitglied der Aspose.Imaging.FillMode Liste, die den Stil der Füllung bestimmt.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillPolygon(Brush, Punkt[])

Fülle das Innere eines Polygons, das durch eine Reihe von Punkten definiert wird, die durch Aspose.Imaging.Point-Strukturen und Aspose.Imaging.FillMode.Alternate angegeben sind.

public void FillPolygon(Brush brush, Point[] points)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spitzen des Polygons darstellen, um zu füllen.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillPolygon(Brush, Punkt[][], und FillMode)

Füllt das Innere eines Polygons, das durch eine Reihe von Punkten definiert wird, die durch Aspose.Imaging.Point-Strukturen mit dem angegebenen Füllmodus angegeben werden.

public void FillPolygon(Brush brush, Point[] points, FillMode fillMode)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

points Point [][]

Eine Reihe von Aspose.Imaging.Point-Strukturen, die die Spitzen des Polygons darstellen, um zu füllen.

fillMode FillMode

Mitglied der Aspose.Imaging.FillMode Liste, die den Stil der Füllung bestimmt.

Exceptions

ArgumentNullException

brush’ is null.-or-points’ is null.

FillRectangle(Brush und Rectangle)

Fülle den Innenraum eines rektangels, der durch eine Aspose.Imaging.Rectangle Struktur angegeben ist.

public void FillRectangle(Brush brush, Rectangle rect)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rect Rectangle

Aspose.Imaging.Rectangle Struktur, die die rechte Ecke darstellt, um zu füllen.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Brush und RectangleF)

Fülle das Innere eines rektangels, der durch eine Aspose.Imaging.RectangleF Struktur angegeben ist.

public void FillRectangle(Brush brush, RectangleF rect)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rect RectangleF

Aspose.Imaging.RectangleF Struktur, die die rechte Ecke darstellt, um zu füllen.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Brush, float, float, float, float)

Fülle das Innere eines rechten Kugels, das von einem Paar Koordinaten, einer Breite und einer Höhe angegeben wird.

public void FillRectangle(Brush brush, float x, float y, float width, float height)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

x float

Die x-Koordinate des oberen linken Winkel des Rechteckens zu füllen.

y float

Der Y-Koordinat des oberen linken Winkel des Rechteckens zu füllen.

width float

Die Breite des Rechtangels zu füllen.

height float

Höhen des Rechteckens zu füllen.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Brush, int, int, int, int)

Fülle das Innere eines rechten Kugels, das von einem Paar Koordinaten, einer Breite und einer Höhe angegeben wird.

public void FillRectangle(Brush brush, int x, int y, int width, int height)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

x int

Die x-Koordinate des oberen linken Winkel des Rechteckens zu füllen.

y int

Der Y-Koordinat des oberen linken Winkel des Rechteckens zu füllen.

width int

Die Breite des Rechtangels zu füllen.

height int

Höhen des Rechteckens zu füllen.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangles(Brush und Rectangle[])

Füllt die Innenräume einer Reihe von Rechtecken, die von Aspose.Imaging.Rectangle Strukturen angegeben sind.

public void FillRectangles(Brush brush, Rectangle[] rects)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rects Rectangle [][]

Eine Reihe von Aspose.Imaging.Rectangle Strukturen, die die Rechte zu füllen repräsentieren.

Exceptions

ArgumentNullException

brush’ is null or rects’ is null.

FillRectangles(Brush und RectangleF[])

Füllt die Innenräume einer Reihe von Rechtecken, die durch Aspose.Imaging.RectangleF Strukturen angegeben sind.

public void FillRectangles(Brush brush, RectangleF[] rects)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

rects RectangleF [][]

Eine Reihe von Aspose.Imaging.Rectangle Strukturen, die die Rechte zu füllen repräsentieren.

Exceptions

ArgumentNullException

brush’ is null or rects’ is null.

FillRegion(Brush, Region)

Fülle das Innere eines Aspose.Imaging.Region.

public void FillRegion(Brush brush, Region region)

Parameters

brush Brush

Aspose.Imaging.Brush, die die Merkmale der Füllung bestimmt.

region Region

Aspose.Imaging.Region, die das Gebiet repräsentiert.

Exceptions

ArgumentNullException

brush’ is null.-or-region’ is null.

~Graphics()

protected ~Graphics()

MeasureString(String, Font, SizeF, StringFormat)

Messung der angegebenen Textrad mit angegebenen Parameter

public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)

Parameters

text string

Text zu messen.

font Font

Die Schrift zu messen.

layoutArea SizeF

Das Layoutgebiet.

stringFormat StringFormat

Das String Format.

Returns

SizeF

Größe in Pixeln von gemessenem Textstring

MultiplyTransform(Matrix)

Es multipliziert die Aspose.Imaging.Matrix, die die lokale geometrische Transformation dieser Aspose.Imaging.Graphics durch die angegebenen Aspose.Imaging.Matrix darstellt, indem sie die angegebenen Aspose.Imaging.Matrix präpendiert.

public void MultiplyTransform(Matrix matrix)

Parameters

matrix Matrix

Die Aspose.Imaging.Matrix durch die die geometrische Transformation multiplizieren.

MultiplyTransform(Matrix und MatrixOrder)

Multipliziert die Aspose.Imaging.Matrix, die die lokale geometrische Transformation dieser Aspose.Imaging.Graphics durch die angegebenen Aspose.Imaging.Matrix in der angegebenen Reihenfolge darstellt.

public void MultiplyTransform(Matrix matrix, MatrixOrder order)

Parameters

matrix Matrix

Die Aspose.Imaging.Matrix durch die die geometrische Transformation multiplizieren.

order MatrixOrder

Ein Aspose.Imaging.MatrixOrder, der festlegt, in welchem Zweck die beiden Matrizen zu multiplizieren.

ResetTransform()

Wiederherstellen Sie Aspose.Imaging.Graphics.Transformieren Sie Eigentum in Identität.

public void ResetTransform()

RotateTransform(Flotte)

Rotiert die lokale geometrische Transformation durch die angegebenen Menge. Diese Methode verhängt die Rotation an die Transformation.

public void RotateTransform(float angle)

Parameters

angle float

Der Winkel der Rotation.

RotateTransform(Flöte, MatrixOrder)

Rotiert die lokale geometrische Transformation durch die angegebenen Menge in der angegebenen Reihenfolge.

public void RotateTransform(float angle, MatrixOrder order)

Parameters

angle float

Der Winkel der Rotation.

order MatrixOrder

Ein Aspose.Imaging.MatrixOrder, der angibt, ob die Rotationsmatrix hinzugefügt oder vorzugefügt wird.

ScaleTransform(Flotte und Flotte)

Skalieren Sie die lokale geometrische Transformation durch die angegebenen Mengen. Diese Methode verhängt die Skalierungsmatrix an die Transformation.

public void ScaleTransform(float sx, float sy)

Parameters

sx float

Die Menge, durch die die Transformation in der X-Axi-Richtung skaliert werden soll.

sy float

Die Menge, durch die die Transformation in der Y-Axis-Richtung skaliert werden soll.

ScaleTransform(Flotte, Flotte und MatrixOrder)

Skalieren Sie die lokale geometrische Transformation durch die angegebenen Mengen in der angegebenen Reihenfolge.

public void ScaleTransform(float sx, float sy, MatrixOrder order)

Parameters

sx float

Die Menge, durch die die Transformation in der X-Axi-Richtung skaliert werden soll.

sy float

Die Menge, durch die die Transformation in der Y-Axis-Richtung skaliert werden soll.

order MatrixOrder

Ein Aspose.Imaging.MatrixOrder, der angibt, ob die Skalierungsmatrix hinzugefügt oder vorzugefügt wird.

TranslateTransform(Flotte und Flotte)

bersetzt die lokale geometrische Transformation durch die angegebenen Dimensionen. Diese Methode verhängt die Übersetzung an die Transformation.

public void TranslateTransform(float dx, float dy)

Parameters

dx float

Der Wert der Übersetzung in x.

dy float

Der Wert der Übersetzung in y.

TranslateTransform(Flotte, Flotte und MatrixOrder)

bersetzt die lokale geometrische Transformation durch die angegebenen Dimensionen in der angegebenen Reihenfolge.

public void TranslateTransform(float dx, float dy, MatrixOrder order)

Parameters

dx float

Der Wert der Übersetzung in x.

dy float

Der Wert der Übersetzung in y.

order MatrixOrder

Die Bestellung (prepend oder append), in der die Übersetzung angewendet werden soll.

 Deutsch