Class Graphics

Class Graphics

Název místa: Aspose.Imaging Shromáždění: Aspose.Imaging.dll (25.4.0)

Představuje grafiku podle grafického motoru používaného v současné montáži.

public sealed class Graphics

Inheritance

object Graphics

Dědiční členové

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

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

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

Začíná nový příklad třídy Aspose.Imaging.Graphics.

public Graphics(Image sourceImage)

Parameters

sourceImage Image

Zdrojový obrázek.

Properties

Clip

Získejte nebo nastavte klip regionu.

public Region Clip { get; set; }

Hodnota nemovitosti

Region

CompositingQuality

Získáte nebo nastavte kompozitní kvalitu.

public CompositingQuality CompositingQuality { get; set; }

Hodnota nemovitosti

CompositingQuality

Dpix

Získáte horizontální rozlišení tohoto Aspose.Imaging.Graphics.

public float DpiX { get; }

Hodnota nemovitosti

float

Dpiy

Získejte vertikální rozlišení tohoto Aspose.Imaging.Graphics.

public float DpiY { get; }

Hodnota nemovitosti

float

Image

Dostane obrázek.

public Image Image { get; }

Hodnota nemovitosti

Image

InterpolationMode

Obdržíte nebo nastavíte režim interpolace.

public InterpolationMode InterpolationMode { get; set; }

Hodnota nemovitosti

InterpolationMode

IsInBeginUpdateCall

Obdrží hodnotu, která naznačuje, zda je grafika ve stavu volání StartUpdate.

public bool IsInBeginUpdateCall { get; }

Hodnota nemovitosti

bool

PageScale

Získáte nebo nastavte skalování mezi světovými jednotkami a stranovými jednotkami pro tento Aspose.Imaging.Graphics.

public float PageScale { get; set; }

Hodnota nemovitosti

float

PageUnit

Obdržíte nebo nastavíte jednotku měření používanou pro koordináty stránek v této Aspose.Imaging.Graphics.

public GraphicsUnit PageUnit { get; set; }

Hodnota nemovitosti

GraphicsUnit

PaintableImageOptions

Obdrží nebo nastaví možnosti obrazu, které se používají k vytvoření barevných vákuových snímků k kreslen.

public ImageOptionsBase PaintableImageOptions { get; set; }

Hodnota nemovitosti

ImageOptionsBase

SmoothingMode

Obdržíte nebo nastavte režim úklidu.

public SmoothingMode SmoothingMode { get; set; }

Hodnota nemovitosti

SmoothingMode

TextRenderingHint

Obdržíte nebo nastavíte text odrážející návod.

public TextRenderingHint TextRenderingHint { get; set; }

Hodnota nemovitosti

TextRenderingHint

Transform

Obdržíte nebo nastavíte kopii geometrické světové transformace pro tento Aspose.Imaging.Graphics.

public Matrix Transform { get; set; }

Hodnota nemovitosti

Matrix

Methods

BeginUpdate()

Začíná caching následujících grafických operací. grafické efekty aplikované poté nebudou aplikovány okamžitě namísto EndUpdate způsobí aplikace všech efektů najednou.

public void BeginUpdate()

Remarks

Vezměte prosím na vědomí, že výsledky po zavolání BeginUpdate nebudou použity v případě, že EndUpdate není zavolán.

Clear(Color)

Vyčistí grafickou plochu pomocí specifikované barvy.

public void Clear(Color color)

Parameters

color Color

Barva vyčistí grafickou plochu.

Examples

Tyto příklady používají třídu GraphicsPath a Graphics, aby vytvořily a manipulovaly postavy na obrazové povrchu. Příklad vytváří nový obraz (typu Tiff), vyčistí povrch a vytváří trasy s pomocí třídy GraphicsPath.

//Create an instance of FileStream
                                                                                                                                                                                                                                                                                                                                             using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
                                                                                                                                                                                                                                                                                                                                             {
                                                                                                                                                                                                                                                                                                                                                 //Create an instance of TiffOptions and set its various properties
                                                                                                                                                                                                                                                                                                                                                 Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

                                                                                                                                                                                                                                                                                                                                                 //Set the source for the instance of ImageOptions
                                                                                                                                                                                                                                                                                                                                                 tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);

                                                                                                                                                                                                                                                                                                                                                 //Create an instance of Image 
                                                                                                                                                                                                                                                                                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
                                                                                                                                                                                                                                                                                                                                                 {
                                                                                                                                                                                                                                                                                                                                                     //Create and initialize an instance of Graphics class
                                                                                                                                                                                                                                                                                                                                                     Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                                                                                                                                                                                                                                     //Clear Graphics surface
                                                                                                                                                                                                                                                                                                                                                     graphics.Clear(Color.Wheat);

                                                                                                                                                                                                                                                                                                                                                     //Create an instance of GraphicsPath class
                                                                                                                                                                                                                                                                                                                                                     Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();

                                                                                                                                                                                                                                                                                                                                                     //Create an instance of Figure class
                                                                                                                                                                                                                                                                                                                                                     Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();

                                                                                                                                                                                                                                                                                                                                                     //Add Shapes to Figure object
                                                                                                                                                                                                                                                                                                                                                     figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
                                                                                                                                                                                                                                                                                                                                                     figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
                                                                                                                                                                                                                                                                                                                                                     figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));

                                                                                                                                                                                                                                                                                                                                                     //Add Figure object to GraphicsPath
                                                                                                                                                                                                                                                                                                                                                     graphicspath.AddFigure(figure);

                                                                                                                                                                                                                                                                                                                                                     //Draw path with Pen object of color Black
                                                                                                                                                                                                                                                                                                                                                     graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);

                                                                                                                                                                                                                                                                                                                                                     // save all changes.
                                                                                                                                                                                                                                                                                                                                                     image.Save();
                                                                                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                                                                                             }

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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(Peníze, loď, loď, loď, loď, loď, loď)

Drží oblohu, která představuje část elipty, kterou určuje pár koordinátů, šířka a výška.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl arku.

x float

X-koordinát horního levého rohu pravého úhlu, který definuje elips.

y float

Y-koordinát horního levého rohu pravého úhlu, který definuje ellipsu.

width float

ka obdélníku, která definuje elips.

height float

Výška obdélníku, která definuje elips.

startAngle float

hel v stupních se měří hodinově od x-axe k výchozímu bodu ark.

sweepAngle float

hel ve stupních se měří časově od parametru startAngle’ do konce bodu arku.

Exceptions

ArgumentNullException

pen’ is null.

DrawArc(Pen, RectangleF, flotilní, flotilní)

Drží oblohu, která představuje část elipsy specifikovanou strukturou Aspose.Imaging.RectangleF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl arku.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která definuje hranice elipsy.

startAngle float

hel v stupních se měří hodinově od x-axe k výchozímu bodu ark.

sweepAngle float

hel ve stupních se měří časově od parametru startAngle’ do konce bodu arku.

Exceptions

ArgumentNullException

pen’ is null

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

Drží oblohu, která představuje část elipty, kterou určuje pár koordinátů, šířka a výška.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl arku.

x int

X-koordinát horního levého rohu pravého úhlu, který definuje elips.

y int

Y-koordinát horního levého rohu pravého úhlu, který definuje ellipsu.

width int

ka obdélníku, která definuje elips.

height int

Výška obdélníku, která definuje elips.

startAngle int

hel v stupních se měří hodinově od x-axe k výchozímu bodu ark.

sweepAngle int

hel ve stupních se měří časově od parametru startAngle’ do konce bodu arku.

Exceptions

ArgumentNullException

pen’ is null.

DrawArc(Pen, rektangle, plavba, plavba)

Drží oblohu, která představuje část elipsy specifikovanou strukturou Aspose.Imaging.Rectangle.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl arku.

rect Rectangle

Aspose.Imaging.RectangleF struktura, která definuje hranice elipsy.

startAngle float

hel v stupních se měří hodinově od x-axe k výchozímu bodu ark.

sweepAngle float

hel ve stupních se měří časově od parametru startAngle’ do konce bodu arku.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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(Peníze, loď, loď, loď, loď, loď, loď, loď, loď)

Drží Bézier spline definované čtyřmi objednanými páry koordinátů, které představují body.

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, který určuje barvu, šířku a styl kurvy.

x1 float

X-koordinát výchozího bodu kurvy.

y1 float

Y-koordinát výchozího bodu kurvy.

x2 float

X-koordinát prvního kontrolního bodu kurvy.

y2 float

Y-koordinát prvního kontrolního bodu kurvy.

x3 float

X-koordinát druhého kontrolního bodu kurvy.

y3 float

Y-koordinát druhého kontrolního bodu kurvy.

x4 float

X-koordinát končícího bodu kurvy.

y4 float

Y-koordinát končícího bodu kurvy.

Exceptions

ArgumentNullException

pen’ is null.

DrawBezier(Počítač, PointF, PointF, PointF)

Tvorí Bézier spline definované čtyřmi strukturami Aspose.Imaging.PointF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl kurvy.

pt1 PointF

Aspose.Imaging.PointF struktura, která představuje výchozí bod kurvy.

pt2 PointF

Aspose.Imaging.PointF struktura, která představuje první kontrolní bod pro kurvy.

pt3 PointF

Aspose.Imaging.PointF struktura, která představuje druhou kontrolní bod pro kurvy.

pt4 PointF

Aspose.Imaging.PointF struktura, která představuje konec kurva.

Exceptions

ArgumentNullException

pen’ is null.

DrawBezier(bod, bod, bod, bod, bod)

Tvorí Bézier spline definované čtyřmi strukturami Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen struktura, která určuje barvu, šířku a styl kurvy.

pt1 Point

Aspose.Imaging.Point struktura, která představuje výchozí bod kurvy.

pt2 Point

Aspose.Imaging.Point struktura, která představuje první kontrolní bod pro kurvy.

pt3 Point

Aspose.Imaging.Point struktura, která představuje druhou kontrolní bod pro kurvy.

pt4 Point

Aspose.Imaging.Point struktura, která představuje konec bodu kurvy.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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(Půda, bod[])

Vyrábí sérii Bézier splines z řady struktur Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl kurvy.

points Point []a[]

ada Aspose.Imaging.Point struktury, které představují body, které určují křivku.

Exceptions

ArgumentNullException

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

DrawBeziers(Peníze, PointF[])

Vyrábí sérii Bézier splines z řady struktur Aspose.Imaging.PointF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl kurvy.

points PointF []a[]

ada struktur Aspose.Imaging.PointF, které představují body, které určují křivku.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Peníze, PointF[])

Drží uzavřenou kardinální spline definovanou řadou struktur Aspose.Imaging.PointF. Tato metoda používá výchozí napětí 0,5 a Aspose.Imaging.FillMode.Alternate režim vyplněn.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Peníze, PointF[]a[], a float)

Drží uzavřenou kardinální spline definovanou řadou struktur Aspose.Imaging.PointF pomocí specifikovaného napětí. Tato metoda používá výchozí Aspose.Imaging.FillMode.Alternate režim vyplněn.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Půda, bod[])

Drží uzavřenou kardinální spline definovanou řadou struktur Aspose.Imaging.Point. Tato metoda používá výchozí napětí 0,5 a Aspose.Imaging.FillMode.Alternate režim vyplněn.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Půda, bod[]a[], a float)

Drží uzavřenou kardinální spline definovanou řadou struktur Aspose.Imaging.Point pomocí určitého napětí. Tato metoda používá výchozí Aspose.Imaging.FillMode.Alternate režim vyplněn.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Peníze, PointF[])

Drží kardinální spline přes určitou řadu struktur Aspose.Imaging.PointF. Tato metoda používá výchozí napětí 0,5.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

Exceptions

ArgumentNullException

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

DrawCurve(Peníze, PointF[]a[], a float)

Drží kardinální spline přes určitou řadu struktur Aspose.Imaging.PointF pomocí určitého napět.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points PointF []a[]

ada struktur Aspose.Imaging.PointF, které představují body, které definují kurvy.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Peníze, PointF[]a[], int , int)

Drží kardinální spline přes specifikovanou řadu struktur Aspose.Imaging.PointF. Kreslení začíná od počátku řady.Tato metoda používá výchozí napětí 0,5.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

offset int

Odstranit z prvního prvku v řadě parametrů bodů k výchozímu bodu v kurv.

numberOfSegments int

Počet segmentů po výchozím bodu, který je třeba zahrnout do kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Peníze, PointF[]a[], int , int , float)

Drží kardinální spline přes určitou řadu struktur Aspose.Imaging.PointF pomocí určitého napět.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

offset int

Odstranit z prvního prvku v řadě parametrů bodů k výchozímu bodu v kurv.

numberOfSegments int

Počet segmentů po výchozím bodu, který je třeba zahrnout do kurvy.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Půda, bod[])

Vytahuje kardinální spline přes určitou řadu struktur Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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(Půda, bod[]a[], a float)

Drží kardinální spline přes určitou řadu struktur Aspose.Imaging.Point pomocí určitého napět.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Půda, bod[]a[], int , int , float)

Drží kardinální spline přes určitou řadu struktur Aspose.Imaging.Point pomocí určitého napět.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a výšku kurvy.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

offset int

Odstranit z prvního prvku v řadě parametrů bodů k výchozímu bodu v kurv.

numberOfSegments int

Počet segmentů po výchozím bodu, který je třeba zahrnout do kurvy.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

DrawEllipse(Peníze, RectangleF)

Vyrábí ellipsu definovanou limitací Aspose.Imaging.RectangleF.

public void DrawEllipse(Pen pen, RectangleF rect)

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl elipsy.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která definuje hranice elipsy.

Exceptions

ArgumentNullException

pen’ is null.

DrawEllipse(Peníze, flotila, flotila, flotila)

Drží ellipsu definovanou oboustranným obdélníkem určeným párem koordinátů, výškou a šířkou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl elipsy.

x float

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

y float

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

width float

ka hraničního obdélníku, který definuje elips.

height float

Výška hraniční obdélníku, která definuje elips.

Exceptions

ArgumentNullException

pen’ is null.

DrawEllipse(Pen, rektangle)

Převádí elliptu specifikovanou limitovanou strukturou Aspose.Imaging.Rectangle.

public void DrawEllipse(Pen pen, Rectangle rect)

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl elipsy.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která definuje hranice elipsy.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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íze, int, int, int)

Drží ellipsu definovanou oboustranným obdélníkem určeným párem koordinátů, výškou a šířkou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl elipsy.

x int

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

y int

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

width int

ka hraničního obdélníku, který definuje elips.

height int

Výška hraniční obdélníku, která definuje elips.

Exceptions

ArgumentNullException

pen’ is null.

DrawImage(Obrázek, PointF)

Vložte specifikovaný Aspose.Imaging.Graphics.Image, pomocí jeho původní fyzické velikosti, na specifikovaném míst.

public void DrawImage(Image sourceImage, PointF point)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

point PointF

Aspose.Imaging.PointF struktura, která představuje horní levý rohem natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, float, float)

Vložte specifikovaný Aspose.Imaging.Graphics.Image, pomocí jeho původní fyzické velikosti, na specifikovaném míst.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

x float

X-koordinát horního levého rohu natáčeného obrazu.

y float

Y-koordinát horního levého rohu natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, RectangleF)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

public void DrawImage(Image sourceImage, RectangleF rect)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která určuje umístění a velikost natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, Rectangle, Graphics)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectDestination Rectangle

Cílem je rektangle.

graphicsUnit GraphicsUnit

Grafická jednotka.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, RectangleF, GraphicsUnit)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectDestination RectangleF

Cílem je rektangle.

graphicsUnit GraphicsUnit

Grafická jednotka.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, Rectangle, GraphicsUnit, ImageAttributes)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectDestination Rectangle

Cílem je rektangle.

graphicsUnit GraphicsUnit

Grafická jednotka.

imageAttributes ImageAttributes

Obrázek má atributy.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, RectangleF, GraphicsUnit, ImageAttributes)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectDestination RectangleF

Cílem je vytáhnout do cílového úhlu.

graphicsUnit GraphicsUnit

Grafická jednotka.

imageAttributes ImageAttributes

Obrázek má atributy.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(obrázek, Rectangle, Rectangle, GraphicsUnit)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectSource Rectangle

Zpět na pravý zdroj.

rectDestination Rectangle

Pravá cílová místa.

graphicsUnit GraphicsUnit

Grafická jednotka.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(obrázek, RectangleF, RectangleF, GraphicsUnit)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectSource RectangleF

Zpět na pravý zdroj.

rectDestination RectangleF

Pravá cílová místa.

graphicsUnit GraphicsUnit

Grafická jednotka.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, Rectangle, Rectangle, GraphicsUnit, ImageAttributes)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectSource Rectangle

Zpět na pravý zdroj.

rectDestination Rectangle

Pravá cílová místa.

graphicsUnit GraphicsUnit

Grafická jednotka.

imageAttributes ImageAttributes

Obrázek má atributy.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, RectangleF, RectangleF, GraphicsUnit, ImageAttributes)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rectSource RectangleF

Původní obdélníkem.

rectDestination RectangleF

Cílem je rektangle.

graphicsUnit GraphicsUnit

Grafická jednotka k použit.

imageAttributes ImageAttributes

Obrázek se přiznává k použit.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, bod[])

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints Point []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

DrawImage(Obrázek, bod[]a[], rektangle)

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints Point []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

srcRect Rectangle

Původní obdélníkem.

DrawImage(Obrázek, bod[]a[], Rectangle , GraphicsUnit)

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints Point []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

srcRect Rectangle

Původní obdélníkem.

srcUnit GraphicsUnit

Jednotky pro měřen.

DrawImage(Obrázek, bod[]a[], Rectangle, GraphicsUnit, ImageAttributes)

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints Point []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

srcRect Rectangle

Původní obdélníkem.

srcUnit GraphicsUnit

Jednotky pro měřen.

imageAttributes ImageAttributes

Obrázek má atributy.

DrawImage(Obrázek, PointF[])

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints PointF []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

Exceptions

ArgumentNullException

obrázek

DrawImage(Obrázek, PointF[]a[], RectangleF)

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints PointF []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

srcRect RectangleF

Původní obdélníkem.

DrawImage(Obrázek, PointF[]a[], RectangleF, GraphicsUnit)

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints PointF []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

srcRect RectangleF

Původní obdélníkem.

srcUnit GraphicsUnit

Jednotky pro měřen.

DrawImage(Obrázek, PointF[]a[], RectangleF, GraphicsUnit, ImageAttributes)

Vložte specifikovanou část specifikovaného image" na specifikovaném místě a s specifikovanou velikost.

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

Parameters

image Image

Obrázek na natáčen.

destPoints PointF []a[]

Obsahuje tři struktury PointF, které definují paralelogram.

srcRect RectangleF

Původní obdélníkem.

srcUnit GraphicsUnit

Jednotky pro měřen.

imageAttributes ImageAttributes

Obrázek má atributy.

DrawImage(Obrázek, flotila, flotila, flotila)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

x float

X-koordinát horního levého rohu natáčeného obrazu.

y float

Y-koordinát horního levého rohu natáčeného obrazu.

width float

Rozsah natáčeného obrazu.

height float

Výška natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, bod)

Vložte specifikovaný Aspose.Imaging.Graphics.Image, pomocí jeho původní fyzické velikosti, na specifikovaném míst.

public void DrawImage(Image sourceImage, Point point)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

point Point

Aspose.Imaging.Point struktura, která představuje umístění horního levého rohu natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(obrázek, int, int)

Vložte specifikovaný obrázek, pomocí jeho původní fyzické velikosti, na místě uvedeném koordinátním párem.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

x int

X-koordinát horního levého rohu natáčeného obrazu.

y int

Y-koordinát horního levého rohu natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázek, Rectangle)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

public void DrawImage(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která určuje umístění a velikost natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(obrázek, int, int, int, int)

Vytvořte specifikovaný Aspose.Imaging.Graphics.Image na specifikovaném místě a s specifikovanou velikost.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

x int

X-koordinát horního levého rohu natáčeného obrazu.

y int

Y-koordinát horního levého rohu natáčeného obrazu.

width int

Rozsah natáčeného obrazu.

height int

Výška natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Obrázek, bod)

Vytvořte specifikovaný obrázek pomocí jeho původní fyzické velikosti na specifikovaném míst.

public void DrawImageUnscaled(Image sourceImage, Point point)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

point Point

Aspose.Imaging.Point struktura, která určuje horní levý rohem natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(obrázek, int, int)

Vytvořte specifikovaný obrázek pomocí jeho původní fyzické velikosti na místě uvedeném koordinátním párem.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

x int

X-koordinát horního levého rohu natáčeného obrazu.

y int

Y-koordinát horního levého rohu natáčeného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Obrázek, Rectangle)

Vytvořte specifikovaný obrázek pomocí jeho původní fyzické velikosti na specifikovaném míst.

public void DrawImageUnscaled(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rect Rectangle

Aspose.Imaging.Rectangle, který specifikuje horní levý úhel natáčeného obrazu. X a Y vlastnosti pravého úhlu specifikují horní levý úhel.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(obrázek, int, int, int, int)

Vytvořte specifikovaný obrázek pomocí jeho původní fyzické velikosti na specifikovaném míst.

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

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

x int

X-koordinát horního levého rohu natáčeného obrazu.

y int

Y-koordinát horního levého rohu natáčeného obrazu.

width int

Parametry se nepoužívaj.

height int

Parametry se nepoužívaj.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaledAndClipped(Obrázek, Rectangle)

Vytahuje specifikovaný obrázek bez skalování a v případě potřeby klepne tak, aby se hodil do specifikovaného pravého úhlu.

public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Obrázek, s nímž je třeba vytáhnout.

rect Rectangle

Aspose.Imaging.Rectangle, ve kterém můžete kreslit obrázek.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawLine(bod, bod, bod)

Vytváří linku, která spojuje dvě struktury Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl řádku.

point1 Point

Aspose.Imaging.Point struktura, která představuje první bod pro připojen.

point2 Point

Aspose.Imaging.Point struktura, která představuje druhý bod pro připojen.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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(Pen, PointF a PointF)

Vytváří linku, která spojuje dvě struktury Aspose.Imaging.PointF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl řádku.

point1 PointF

Aspose.Imaging.PointF struktura, která představuje první bod pro připojen.

point2 PointF

Aspose.Imaging.PointF struktura, která představuje druhý bod pro připojen.

Exceptions

ArgumentNullException

pen’ is null.

DrawLine(Peníze, int, int, int)

eší linku, která spojuje dvě body určené koordinátními páry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl řádku.

x1 int

Koordinát x prvního bodu.

y1 int

Koordinace prvního bodu.

x2 int

Koordinát x druhého bodu.

y2 int

a) koordinace druhého bodu.

Exceptions

ArgumentNullException

pen’ is null.

DrawLine(Peníze, flotila, flotila, flotila)

eší linku, která spojuje dvě body určené koordinátními páry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl řádku.

x1 float

Koordinát x prvního bodu.

y1 float

Koordinace prvního bodu.

x2 float

Koordinát x druhého bodu.

y2 float

a) koordinace druhého bodu.

Exceptions

ArgumentNullException

pen’ is null.

DrawLines(Půda, bod[])

Vytváří řadu řádkových segmentů, které spojují řadu struktur Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl řádkových segment.

points Point []a[]

Soubor Aspose.Imaging.Point struktury, které představují body k připojen.

Exceptions

ArgumentNullException

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

ArgumentException

Rozsah bodů obsahuje méně než 2 body.

DrawLines(Peníze, PointF[])

Vytváří řadu řádkových segmentů, které spojují řadu struktur Aspose.Imaging.PointF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl řádkových segment.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které představují body k připojen.

Exceptions

ArgumentNullException

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

ArgumentException

Rozsah bodů obsahuje méně než 2 body.

DrawPath(Peníze, GraphicsPath)

Přehrávejte Aspose.Imaging.GraphicsPath.

public void DrawPath(Pen pen, GraphicsPath path)

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl cesty.

path GraphicsPath

Zobrazit obrázek.GraphicsPath to draw.

Examples

Tyto příklady používají třídu GraphicsPath a Graphics, aby vytvořily a manipulovaly postavy na obrazové povrchu. Příklad vytváří nový obraz (typu Tiff), vyčistí povrch a vytváří trasy s pomocí třídy GraphicsPath.

//Create an instance of FileStream
                                                                                                                                                                                                                                                                                                                                             using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
                                                                                                                                                                                                                                                                                                                                             {
                                                                                                                                                                                                                                                                                                                                                 //Create an instance of TiffOptions and set its various properties
                                                                                                                                                                                                                                                                                                                                                 Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

                                                                                                                                                                                                                                                                                                                                                 //Set the source for the instance of ImageOptions
                                                                                                                                                                                                                                                                                                                                                 tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);

                                                                                                                                                                                                                                                                                                                                                 //Create an instance of Image 
                                                                                                                                                                                                                                                                                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
                                                                                                                                                                                                                                                                                                                                                 {
                                                                                                                                                                                                                                                                                                                                                     //Create and initialize an instance of Graphics class
                                                                                                                                                                                                                                                                                                                                                     Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                                                                                                                                                                                                                                     //Clear Graphics surface
                                                                                                                                                                                                                                                                                                                                                     graphics.Clear(Color.Wheat);

                                                                                                                                                                                                                                                                                                                                                     //Create an instance of GraphicsPath class
                                                                                                                                                                                                                                                                                                                                                     Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();

                                                                                                                                                                                                                                                                                                                                                     //Create an instance of Figure class
                                                                                                                                                                                                                                                                                                                                                     Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();

                                                                                                                                                                                                                                                                                                                                                     //Add Shapes to Figure object
                                                                                                                                                                                                                                                                                                                                                     figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
                                                                                                                                                                                                                                                                                                                                                     figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
                                                                                                                                                                                                                                                                                                                                                     figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));

                                                                                                                                                                                                                                                                                                                                                     //Add Figure object to GraphicsPath
                                                                                                                                                                                                                                                                                                                                                     graphicspath.AddFigure(figure);

                                                                                                                                                                                                                                                                                                                                                     //Draw path with Pen object of color Black
                                                                                                                                                                                                                                                                                                                                                     graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);

                                                                                                                                                                                                                                                                                                                                                     // save all changes.
                                                                                                                                                                                                                                                                                                                                                     image.Save();
                                                                                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                                                                                             }

Exceptions

ArgumentNullException

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

DrawPie(Pen, RectangleF, flotilní, flotilní)

Vyrábí tvar pěny definovanou ellipsou specifikovanou strukturou Aspose.Imaging.RectangleF a dvěma radiálními liniemi.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl tvaru pie.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která představuje oboustranný obdélník, který definuje ellipsu, z něhož pochází tvar pěny.

startAngle float

hel se měří ve stupních hodinové směry od x-axe k první straně tvaru pie.

sweepAngle float

hel se měří ve stupních časově od parametru startAngle’ na druhou stranu tvaru pie.

Exceptions

ArgumentNullException

pen’ is null.

DrawPie(Peníze, loď, loď, loď, loď, loď, loď)

Vyrábí tvar pěny definovanou ellipsou specifikovanou koordinátním párem, šířkou, výškou a dvěma radiálními liniemi.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl tvaru pie.

x float

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází tvar pěny.

y float

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází tvar pěny.

width float

ka hraniční obdélníku, která definuje elips, ze kterého pochází tvar pěny.

height float

Výška hraničního pravého úhlu, který definuje elips, ze kterého pochází tvar pěny.

startAngle float

hel se měří ve stupních hodinové směry od x-axe k první straně tvaru pie.

sweepAngle float

hel se měří ve stupních časově od parametru startAngle’ na druhou stranu tvaru pie.

Exceptions

ArgumentNullException

pen’ is null.

DrawPie(Pen, rektangle, plavba, plavba)

Vyrábí tvar pěny definovanou ellipsou specifikovanou strukturou Aspose.Imaging.Rectangle a dvěma radiálními liniemi.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl tvaru pie.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která představuje oboustranný obdélník, který definuje ellipsu, z něhož pochází tvar pěny.

startAngle float

hel se měří ve stupních hodinové směry od x-axe k první straně tvaru pie.

sweepAngle float

hel se měří ve stupních časově od parametru startAngle’ na druhou stranu tvaru pie.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

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

Vyrábí tvar pěny definovanou ellipsou specifikovanou koordinátním párem, šířkou, výškou a dvěma radiálními liniemi.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl tvaru pie.

x int

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází tvar pěny.

y int

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází tvar pěny.

width int

ka hraniční obdélníku, která definuje elips, ze kterého pochází tvar pěny.

height int

Výška hraničního pravého úhlu, který definuje elips, ze kterého pochází tvar pěny.

startAngle int

hel se měří ve stupních hodinové směry od x-axe k první straně tvaru pie.

sweepAngle int

hel se měří ve stupních časově od parametru startAngle’ na druhou stranu tvaru pie.

Exceptions

ArgumentNullException

pen’ is null.

DrawPolygon(Peníze, PointF[])

Vytahuje polygon definovaný řadou struktur Aspose.Imaging.PointF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl polygonu.

points PointF []a[]

Různé struktury Aspose.Imaging.PointF, které představují vertikály polygonu.

Exceptions

ArgumentNullException

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

DrawPolygon(Půda, bod[])

Vytahuje polygon definovaný řadou struktur Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl polygonu.

points Point []a[]

Rozsah Aspose.Imaging.Point struktury, které představují vertikály polygonu.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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íze, RectangleF)

Převádí rektangle specifikované strukturou Aspose.Imaging.RectangleF.

public void DrawRectangle(Pen pen, RectangleF rect)

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl pravého úhlu.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která představuje rektangle, který má být natáčen.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangle(Pen, rektangle)

Vyznačuje se rektanglem specifikovaným strukturou Aspose.Imaging.Rectangle.

public void DrawRectangle(Pen pen, Rectangle rect)

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl pravého úhlu.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která představuje rektangle, který má být natáčen.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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íze, flotila, flotila, flotila)

Drží pravý úhel určený koordinátním párem, šířkou a výškou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl pravého úhlu.

x float

X-koordinát horního levého úhlu pravého úhlu k vytisknut.

y float

Y-koordinát horního levého úhlu pravého úhlu k vytisknut.

width float

ka pravého úhlu, která má být vytisknuta.

height float

Výška pravého úhlu, která má být vytisknuta.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangle(Peníze, int, int, int)

Drží pravý úhel určený koordinátním párem, šířkou a výškou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl pravého úhlu.

x int

X-koordinát horního levého úhlu pravého úhlu k vytisknut.

y int

Y-koordinát horního levého úhlu pravého úhlu k vytisknut.

width int

ka pravého úhlu na natáčen.

height int

Výška pravého úhlu na natáčen.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangles(Peníze, RectangleF[])

Vyrábí řadu rektanglí specifikovaných strukturami Aspose.Imaging.RectangleF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl výstupů obdélníku.

rects RectangleF []a[]

Rozsah Aspose.Imaging.RectangleF struktury, které představují rektangle, které mají být vytisknuty.

Exceptions

ArgumentNullException

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

DrawRectangles(Pen, rektangle[])

Vyrábí řadu rektanglí specifikovaných strukturami Aspose.Imaging.Rectangle.

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

Parameters

pen Pen

Aspose.Imaging.Pen, který určuje barvu, šířku a styl výstupů obdélníku.

rects Rectangle []a[]

Rozsah Aspose.Imaging.Rectangle struktury, které představují rektangle, které mají být vytisknuty.

Examples

Tento příklad ukazuje vytváření a používání penových objektů. Příklad vytváří nový obrázek a vytváří Rectangles na povrchu obrazu.

//Create an instance of BmpOptions and set its various properties
                                                                                                                                       Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
                                                                                                                                       bmpOptions.BitsPerPixel = 24;

                                                                                                                                       //Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
                                                                                                                                       //Second Boolean parameter determines if the file to be created IsTemporal or not
                                                                                                                                       bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);

                                                                                                                                       //Create an instance of Image at specified Path
                                                                                                                                       using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
                                                                                                                                       {
                                                                                                                                           //Create an instance of Graphics and initialize it with Image object
                                                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

                                                                                                                                           //Clear the Graphics sutface with White Color
                                                                                                                                           graphics.Clear(Aspose.Imaging.Color.White);

                                                                                                                                           //Create an instance of Pen with color Red and width 5
                                                                                                                                           Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);

                                                                                                                                           //Create an instance of HatchBrush and set its properties
                                                                                                                                           Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
                                                                                                                                           brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
                                                                                                                                           brush.ForegroundColor = Aspose.Imaging.Color.Red;

                                                                                                                                           //Create an instance of Pen
                                                                                                                                           //initialize it with HatchBrush object and width
                                                                                                                                           Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(pen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           //Draw Rectangles by specifying Pen object
                                                                                                                                           graphics.DrawRectangles(brusedpen, new[]
                                                                                                                                           {
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
                                                                                                                                               new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
                                                                                                                                           });

                                                                                                                                           // save all changes.
                                                                                                                                           image.Save();
                                                                                                                                       }

Exceptions

ArgumentNullException

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

DrawString(Třída, Font, Brush, Float, Float)

Vložte specifikovaný textový řetězec na specifikovaném místě s specifikovanými objekty Aspose.Imaging.Brush a Aspose.Imaging.Font.

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

Parameters

s string

String na natáčen.

font Font

Aspose.Imaging.Font, který definuje textový formát řádku.

brush Brush

Aspose.Imaging.Brush, který určuje barvu a texturu kresleného textu.

x float

X-koordinát horního levého rohu kresleného textu.

y float

Y-koordinát horního levého rohu natáčeného textu.

Exceptions

ArgumentNullException

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

DrawString(Třída, Font, Brush, PointF)

Vložte specifikovaný textový řetězec na specifikovaném místě s specifikovanými objekty Aspose.Imaging.Brush a Aspose.Imaging.Font.

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

Parameters

s string

String na natáčen.

font Font

Aspose.Imaging.Font, který definuje textový formát řádku.

brush Brush

Aspose.Imaging.Brush, který určuje barvu a texturu kresleného textu.

point PointF

Aspose.Imaging.PointF struktura, která určuje horní levý rohem vytlačeného textu.

Examples

Tento příklad používá třídu Graphics k vytvoření primitivních tvarů na povrchu obrazu. k demonstraci operace, příklad vytváří nový obrázek ve formátu PNG a kreslí primitivní tvary na povrchu obrazu pomocí metody kreslení vystavených třídou Graphics

//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(řetěz, Font, Brush, float, float, StringFormat)

Vložte specifikovaný textový řádek na specifikovaném místě pomocí specifikovaných objektů Aspose.Imaging.Brush a Aspose.Imaging.Font pomocí formátovacích atributů specifikovaného Aspose.Imaging.StringFormatu.

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

Parameters

s string

String na natáčen.

font Font

Aspose.Imaging.Font, který definuje textový formát řádku.

brush Brush

Aspose.Imaging.Brush, který určuje barvu a texturu kresleného textu.

x float

X-koordinát horního levého rohu kresleného textu.

y float

Y-koordinát horního levého rohu natáčeného textu.

format StringFormat

Aspose.Imaging.StringFormat, který specifikuje formátování atributy, jako je line spacing a alignment, které jsou aplikovány na kreslený text.

Exceptions

ArgumentNullException

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

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

Vložte specifikovaný textový řádek na specifikovaném místě pomocí specifikovaných objektů Aspose.Imaging.Brush a Aspose.Imaging.Font pomocí formátovacích atributů specifikovaného Aspose.Imaging.StringFormatu.

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

Parameters

s string

String na natáčen.

font Font

Aspose.Imaging.Font, který definuje textový formát řádku.

brush Brush

Aspose.Imaging.Brush, který určuje barvu a texturu kresleného textu.

point PointF

Aspose.Imaging.PointF struktura, která určuje horní levý rohem vytlačeného textu.

format StringFormat

Aspose.Imaging.StringFormat, který specifikuje formátování atributy, jako je line spacing a alignment, které jsou aplikovány na kreslený text.

Exceptions

ArgumentNullException

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

DrawString(Třída, Font, Brush, RectangleF)

Vložte specifikovaný textový řetězec do specifikovaného pravého úhlu s specifikovanými objekty Aspose.Imaging.Brush a Aspose.Imaging.Font.

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

Parameters

s string

String na natáčen.

font Font

Aspose.Imaging.Font, který definuje textový formát řádku.

brush Brush

Aspose.Imaging.Brush, který určuje barvu a texturu kresleného textu.

layoutRectangle RectangleF

Aspose.Imaging.RectangleF struktura, která určuje umístění natáčeného textu.

Exceptions

ArgumentNullException

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

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

Vložte specifikovaný textový řetězec do specifikovaného pravého úhlu s specifikovanými objekty Aspose.Imaging.Brush a Aspose.Imaging.Font pomocí formátovacích atributů specifikovaného Aspose.Imaging.StringFormat.

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

Parameters

s string

String na natáčen.

font Font

Aspose.Imaging.Font, který definuje textový formát řádku.

brush Brush

Aspose.Imaging.Brush, který určuje barvu a texturu kresleného textu.

layoutRectangle RectangleF

Aspose.Imaging.RectangleF struktura, která určuje umístění natáčeného textu.

format StringFormat

Aspose.Imaging.StringFormat, který specifikuje formátování atributy, jako je line spacing a alignment, které jsou aplikovány na kreslený text.

Exceptions

ArgumentNullException

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

EndUpdate()

Končí caching grafických operací zahájených po zavolání BeginUpdate. předchozí grafické operace budou aplikovány okamžitě při zavolání této metody.

public void EndUpdate()

FillClosedCurve(Bruslík, PointF[])

Vyplňuje vnitřek uzavřené kardinální spline kurvy definované řadou struktur Aspose.Imaging.PointF. Tato metoda používá výchozí napětí 0,5 a Aspose.Imaging.FillMode.Alternate režim vyplněn.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

Exceptions

ArgumentNullException

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

FillClosedCurve(Bruslík, PointF[]a[], Stáhnout FillMode)

Vyplní vnitřek uzavřené kardinální šroubové kůry definované řadou struktur Aspose.Imaging.PointF pomocí specifikovaného režimu vyplněn.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

fillMode FillMode

len seznamu Aspose.Imaging.FillMode, který určuje, jak je kurva vyplněna.

Exceptions

ArgumentNullException

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

FillClosedCurve(Bruslík, PointF[]a[], FillMode , Float)

Vyplňuje interiér uzavřené kardinální šroubové kůry definované řadou struktur Aspose.Imaging.PointF pomocí specifikovaného režimu vyplnění a napět.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points PointF []a[]

Soubor struktur Aspose.Imaging.PointF, které definují spline.

fillmode FillMode

len seznamu Aspose.Imaging.FillMode, který určuje, jak je kurva vyplněna.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

FillClosedCurve(Brush - bod[])

Vyplňuje vnitřek uzavřené kardinální šroubové kůry definované řadou struktur Aspose.Imaging.Point. Tato metoda používá výchozí napětí 0,5 a Aspose.Imaging.FillMode.Alternate režim vyplněn.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

Exceptions

ArgumentNullException

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

FillClosedCurve(Brush - bod[]a[], Stáhnout FillMode)

Vyplní vnitřek uzavřené kardinální šroubové kůry definované řadou struktur Aspose.Imaging.Point pomocí specifikovaného režimu vyplněn.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

fillmode FillMode

len seznamu Aspose.Imaging.FillMode, který určuje, jak je kurva vyplněna.

Exceptions

ArgumentNullException

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

FillClosedCurve(Brush - bod[]a[], FillMode , Float)

Vyplňuje interiér uzavřené kardinální šroubové kůry definované řadou struktur Aspose.Imaging.Point pomocí specifikovaného režimu vyplnění a napět.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které definují spline.

fillmode FillMode

len seznamu Aspose.Imaging.FillMode, který určuje, jak je kurva vyplněna.

tension float

Hodnota větší než nebo rovnající se 0,0F, která určuje napětí kurvy.

Exceptions

ArgumentNullException

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

FillEllipse(Bruslík, RectangleF)

Vyplňuje vnitřek elipsy definované oboustranným obdélníkem specifikovaným strukturou Aspose.Imaging.RectangleF.

public void FillEllipse(Brush brush, RectangleF rect)

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která představuje oboustranný obdélník, který definuje elips.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Brus, flotila, flotila, flotila, flotila)

Vyplňuje vnitřek elipty definovanou oboustranným obdélníkem specifikovaným párem koordinátů, šířkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

x float

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

y float

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

width float

ka hraničního obdélníku, který definuje elips.

height float

Výška hraniční obdélníku, která definuje elips.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Bruslík, Rectangle)

Vyplňuje vnitřek elipsy definované oboustranným obdélníkem specifikovaným strukturou Aspose.Imaging.Rectangle.

public void FillEllipse(Brush brush, Rectangle rect)

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která představuje hraniční rektangle, která definuje elips.

Exceptions

ArgumentNullException

brush’ is null.

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

Vyplňuje vnitřek elipty definovanou oboustranným obdélníkem specifikovaným párem koordinátů, šířkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

x int

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

y int

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu.

width int

ka hraničního obdélníku, který definuje elips.

height int

Výška hraniční obdélníku, která definuje elips.

Exceptions

ArgumentNullException

brush’ is null.

FillPath(Bruslík, GrafikaPath)

Vyplňuje interiér Aspose.Imaging.GraphicsPath.

public void FillPath(Brush brush, GraphicsPath path)

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

path GraphicsPath

Aspose.Imaging.GraphicsPath, který představuje cestu k vyplněn.

Exceptions

ArgumentNullException

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

FillPie(Bruslík, rektangle, float, float)

Vyplňuje vnitřek oddílu, který je definován elipsem specifikovaným strukturou Aspose.Imaging.RectangleF a dvěma radiálními liniemi.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která představuje oboustranný rektangle, který definuje elips, ze kterého pochází oddíly pěny.

startAngle float

hel v stupních se měří hodinově od x-axe k první straně oddílu pie.

sweepAngle float

hel ve stupních se měří časově od parametru startAngle’ na druhou stranu oddílu pie.

Examples

Následující příklad ukazuje, jak sestavit animovaný GIF obrázek z jednotlivých GIF blok.

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(Bruslík, RectangleF, float, float)

Vyplňuje vnitřek oddílu, který je definován elipsem specifikovaným strukturou Aspose.Imaging.RectangleF a dvěma radiálními liniemi.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která představuje oboustranný obdélník, který definuje elips, ze kterého pochází oddíly pěny.

startAngle float

hel v stupních se měří hodinově od x-axe k první straně oddílu pie.

sweepAngle float

hel ve stupních se měří časově od parametru startAngle’ na druhou stranu oddílu pie.

Exceptions

ArgumentNullException

brush’ is null.

FillPie(Brus, flotila, flotila, flotila, flotila, flotila)

Vyplňuje vnitřek oddílu, který je definován elipsem, který je určen pár koordinátů, šířkou, výškou a dvěma radiálními liniemi.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

x float

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází oddíly pěny.

y float

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází oddíly pěny.

width float

ka hraniční obdélníku, která definuje elips, ze kterého pochází oddíly pěny.

height float

Výška hraniční obdélníku, která definuje elips, ze kterého pochází oddíly pěny.

startAngle float

hel v stupních se měří hodinově od x-axe k první straně oddílu pie.

sweepAngle float

hel ve stupních se měří časově od parametru startAngle’ na druhou stranu oddílu pie.

Exceptions

ArgumentNullException

brush’ is null.

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

Vyplňuje vnitřek oddílu, který je definován elipsem, který je určen pár koordinátů, šířkou, výškou a dvěma radiálními liniemi.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

x int

X-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází oddíly pěny.

y int

Y-koordinát horního levého rohu závěsného pravého úhlu, který definuje ellipsu, ze kterého pochází oddíly pěny.

width int

ka hraniční obdélníku, která definuje elips, ze kterého pochází oddíly pěny.

height int

Výška hraniční obdélníku, která definuje elips, ze kterého pochází oddíly pěny.

startAngle int

hel v stupních se měří hodinově od x-axe k první straně oddílu pie.

sweepAngle int

hel ve stupních se měří časově od parametru startAngle’ na druhou stranu oddílu pie.

Exceptions

ArgumentNullException

brush’ is null.

FillPolygon(Bruslík, PointF[])

Plní interiér polygonu definovaný řadou bodů specifikovaných strukturami Aspose.Imaging.PointF a Aspose.Imaging.FillMode.Alternate.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points PointF []a[]

Srovnání Aspose.Imaging.PointF struktury, které představují vertikály polygonu k vyplněn.

Exceptions

ArgumentNullException

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

FillPolygon(Bruslík, PointF[]a[], Stáhnout FillMode)

Vyplňuje interiér polygonu definovaného řadou bodů specifikovaných strukturami Aspose.Imaging.PointF pomocí specifikovaného režimu vyplněn.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points PointF []a[]

Srovnání Aspose.Imaging.PointF struktury, které představují vertikály polygonu k vyplněn.

fillMode FillMode

len seznamu Aspose.Imaging.FillMode, který určuje styl plněn.

Exceptions

ArgumentNullException

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

FillPolygon(Brush - bod[])

Vyplňuje interiér polygonu definovaného řadou bodů specifikovaných strukturami Aspose.Imaging.Point a Aspose.Imaging.FillMode.Alternate.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které představují vertikály polygonu k vyplněn.

Exceptions

ArgumentNullException

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

FillPolygon(Brush - bod[]a[], Stáhnout FillMode)

Vyplňuje interiér polygonu definovaného řadou bodů specifikovaných strukturami Aspose.Imaging.Point pomocí specifikovaného režimu vyplněn.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

points Point []a[]

Srovnání Aspose.Imaging.Point struktury, které představují vertikály polygonu k vyplněn.

fillMode FillMode

len seznamu Aspose.Imaging.FillMode, který určuje styl plněn.

Exceptions

ArgumentNullException

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

FillRectangle(Bruslík, Rectangle)

Plní vnitřek pravého úhlu, který je specifikován strukturou Aspose.Imaging.Rectangle.

public void FillRectangle(Brush brush, Rectangle rect)

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rect Rectangle

Aspose.Imaging.Rectangle struktura, která představuje rektangle k vyplněn.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Bruslík, RectangleF)

Plní vnitřek pravého úhlu specifikovaného strukturou Aspose.Imaging.RectangleF.

public void FillRectangle(Brush brush, RectangleF rect)

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rect RectangleF

Aspose.Imaging.RectangleF struktura, která představuje rektangle k vyplněn.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Brus, flotila, flotila, flotila, flotila)

Vyplňuje vnitřek pravého úhlu určeného párem koordinátů, šířkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

x float

X-koordinát horního levého rohu pravého úhlu k vyplněn.

y float

Y-koordinát horního levého rohu pravého úhlu k vyplněn.

width float

ka obdélníku k vyplněn.

height float

Výška obdélníku k vyplněn.

Exceptions

ArgumentNullException

brush’ is null.

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

Vyplňuje vnitřek pravého úhlu určeného párem koordinátů, šířkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

x int

X-koordinát horního levého rohu pravého úhlu k vyplněn.

y int

Y-koordinát horního levého rohu pravého úhlu k vyplněn.

width int

ka obdélníku k vyplněn.

height int

Výška obdélníku k vyplněn.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangles(Bruslík, Rectangle[])

Vyplňuje interiéry řady rektanglí specifikovaných strukturami Aspose.Imaging.Rectangle.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rects Rectangle []a[]

Rozsah Aspose.Imaging.Rectangle struktury, které představují rektangle, které mají být vyplněny.

Exceptions

ArgumentNullException

brush’ is null or rects’ is null.

FillRectangles(Bruslík, RectangleF[])

Vyplňuje interiéry řady rektanglí specifikovaných strukturami Aspose.Imaging.RectangleF.

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

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

rects RectangleF []a[]

Rozsah Aspose.Imaging.Rectangle struktury, které představují rektangle, které mají být vyplněny.

Exceptions

ArgumentNullException

brush’ is null or rects’ is null.

FillRegion(Brush, Region)

Vyplňuje interiér Aspose.Imaging.Region.

public void FillRegion(Brush brush, Region region)

Parameters

brush Brush

Aspose.Imaging.Brush, který určuje charakteristiky plněn.

region Region

Aspose.Imaging.Region, který představuje oblast k vyplněn.

Exceptions

ArgumentNullException

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

~Graphics()

protected ~Graphics()

MeasureString(StringFormat, StringFormat, StringFormat)

Měření specifikovaného textového řetězce s specifikovanými parametry

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

Parameters

text string

Text k měřen.

font Font

Zkratka na měřen.

layoutArea SizeF

v oblasti layout.

stringFormat StringFormat

Formát řetězu.

Returns

SizeF

Velikost v pixelů měřeného textového řetězce

MultiplyTransform(Matrix)

Množuje Aspose.Imaging.Matrix, který představuje místní geometrickou transformaci tohoto Aspose.Imaging.Graphics specifikovaným Aspose.Imaging.Matrix přepínáním specifikovaného Aspose.Imaging.Matrix.

public void MultiplyTransform(Matrix matrix)

Parameters

matrix Matrix

Aspose.Imaging.Matrix, kterým je možné rozmnožovat geometrickou transformaci.

MultiplyTransform(Matrix a MatrixOrder)

Množuje Aspose.Imaging.Matrix, který představuje místní geometrickou transformaci tohoto Aspose.Imaging.Graphics specifikovaným Aspose.Imaging.Matrix v specifikovaném pořad.

public void MultiplyTransform(Matrix matrix, MatrixOrder order)

Parameters

matrix Matrix

Aspose.Imaging.Matrix, kterým je možné rozmnožovat geometrickou transformaci.

order MatrixOrder

Aspose.Imaging.MatrixOrder, který určuje, v jakém smyslu množit dvě matrice.

ResetTransform()

Obnovuje Aspose.Imaging.Graphics.Transformovat vlastnictví na identitu.

public void ResetTransform()

RotateTransform(flotila)

Rotuje místní geometrickou transformaci podle stanoveného množství.Tato metoda předpovídá rotaci transformaci.

public void RotateTransform(float angle)

Parameters

angle float

V úhlu rotace.

RotateTransform(Štěpán, MatrixOrder)

Obrátí místní geometrickou transformaci podle uvedeného množství v uvedeném pořad.

public void RotateTransform(float angle, MatrixOrder order)

Parameters

angle float

V úhlu rotace.

order MatrixOrder

Aspose.Imaging.MatrixOrder, který specifikuje, zda doplnit nebo přepínat rotační matrice.

ScaleTransform(Plzeň, Plzeň)

Rozšířte místní geometrickou transformaci specifikovanými množstvími.Tato metoda předpovídá skalovací matice transformaci.

public void ScaleTransform(float sx, float sy)

Parameters

sx float

Množství, kterým se měří transformace v směru x-axis.

sy float

Množství, kterým se měří transformace ve směru y-axis.

ScaleTransform(plavba, plavba, MatrixOrder)

Rozšířte místní geometrickou transformaci specifikovanými množstvími ve specifikovaném pořad.

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

Parameters

sx float

Množství, kterým se měří transformace v směru x-axis.

sy float

Množství, kterým se měří transformace ve směru y-axis.

order MatrixOrder

Aspose.Imaging.MatrixOrder, který specifikuje, zda doplnit nebo přepínat skalovací matrice.

TranslateTransform(Plzeň, Plzeň)

Překládá lokální geometrickou transformaci podle stanovených rozměrů.Tato metoda předpovídá překlad transformaci.

public void TranslateTransform(float dx, float dy)

Parameters

dx float

hodnotu překladu v x.

dy float

Význam překladu v Y.

TranslateTransform(plavba, plavba, MatrixOrder)

Překládá lokální geometrickou transformaci podle stanovených rozměrů ve stanoveném pořad.

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

Parameters

dx float

hodnotu překladu v x.

dy float

Význam překladu v Y.

order MatrixOrder

Příkaz (prepend nebo append), ve kterém se použije překlad.

 Čeština