Class Graphics

Class Graphics

Pôvodný názov: Aspose.Imaging Zhromaždenie: Aspose.Imaging.dll (25.4.0)

Predstavuje grafiku podľa grafického motora používaného v súčasnej zostave.

public sealed class Graphics

Inheritance

object Graphics

Z dedičných členov

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

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Initalizuje novú inštanciu triedy Aspose.Imaging.Graphics.

public Graphics(Image sourceImage)

Parameters

sourceImage Image

Zdrojový obrázok .

Properties

Clip

Získajte alebo nastavíte klip región.

public Region Clip { get; set; }

Hodnota nehnuteľnosti

Region

CompositingQuality

Získa alebo nastaví kompozitnú kvalitu.

public CompositingQuality CompositingQuality { get; set; }

Hodnota nehnuteľnosti

CompositingQuality

Dpix

Získa horizontálnu rozlíšenie tohto Aspose.Imaging.Graphics.

public float DpiX { get; }

Hodnota nehnuteľnosti

float

Dpija

Získa vertikálnu rozlíšenie tohto Aspose.Imaging.Graphics.

public float DpiY { get; }

Hodnota nehnuteľnosti

float

Image

Získava obraz.

public Image Image { get; }

Hodnota nehnuteľnosti

Image

InterpolationMode

Získajte alebo nastavíte režim interpolácie.

public InterpolationMode InterpolationMode { get; set; }

Hodnota nehnuteľnosti

InterpolationMode

IsInBeginUpdateCall

Získava hodnotu, ktorá ukazuje, či je grafika v stave hovoru BeginUpdate.

public bool IsInBeginUpdateCall { get; }

Hodnota nehnuteľnosti

bool

PageScale

Získajte alebo nastavíte škálovanie medzi svetovými jednotkami a stránkami pre tento Aspose.Imaging.Graphics.

public float PageScale { get; set; }

Hodnota nehnuteľnosti

float

PageUnit

Získajte alebo nastavíte jednotku merania použitú pre koordináty stránky v tomto Aspose.Imaging.Graphics.

public GraphicsUnit PageUnit { get; set; }

Hodnota nehnuteľnosti

GraphicsUnit

PaintableImageOptions

Získajte alebo nastavíte možnosti obrazu, ktoré sa používajú na vytvorenie farebných vákuových obrázkov na natáčanie.

public ImageOptionsBase PaintableImageOptions { get; set; }

Hodnota nehnuteľnosti

ImageOptionsBase

SmoothingMode

Získajte alebo nastavíte režim uvoľňovania.

public SmoothingMode SmoothingMode { get; set; }

Hodnota nehnuteľnosti

SmoothingMode

TextRenderingHint

Získať alebo nastaviť text odovzdávať náznak.

public TextRenderingHint TextRenderingHint { get; set; }

Hodnota nehnuteľnosti

TextRenderingHint

Transform

Získať alebo nastaviť kópiu geometrickej svetovej transformácie pre tento Aspose.Imaging.Graphics.

public Matrix Transform { get; set; }

Hodnota nehnuteľnosti

Matrix

Methods

BeginUpdate()

Začína sa caching nasledujúcich grafických operácií. grafické efekty aplikované neskôr nebudú aplikované okamžite namiesto EndUpdate spôsobí aplikáciu všetkých efektov naraz.

public void BeginUpdate()

Remarks

Upozorňujeme, že účinky po zavolaní BeginUpdate nebudú uplatnené v prípade, že EndUpdate nie je zavolaný.

Clear(Color)

Čistí grafickú plochu pomocou špecifikovanej farby.

public void Clear(Color color)

Parameters

color Color

Farba na vyčistenie grafickej povrchu.

Examples

Tieto príklady používajú triedu GraphicsPath a Grafika na vytvorenie a manipuláciu s Čísla na obrazovej povrchu. Príklad vytvára novú Obrázok (typu Tiff), vyčistí povrch a vytiahne cesty pomocou triedy grafika.

//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 príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Drží oblohu, ktorá predstavuje časť elipcie, ktorá je špecifikovaná pármi koordinátov, šírkou a výškou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl arku.

x float

x-koordinát horného ľavého rohu pravého rohu, ktorý definuje elips.

y float

Y-koordinát horného ľavého rohu pravého rohu, ktorý definuje elips.

width float

Šírka obdĺžnika, ktorý definuje elips.

height float

Výška pravého úhlu, ktorý definuje elips.

startAngle float

Uhol v stupňoch meraný hodinovo od x-axis k východiskovému bodu ark.

sweepAngle float

Úhel v stupňoch sa meria časovo z startAngle’ parameter na dokončenie bodu oblúka.

Exceptions

ArgumentNullException

pen’ is null.

DrawArc(Pen, RectangleF, plavba, plavba)

Drží oblohu, ktorá predstavuje časť elliptu špecifikovanú štruktúrou Aspose.Imaging.RectangleF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl arku.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá definuje hranice elipsy.

startAngle float

Uhol v stupňoch meraný hodinovo od x-axis k východiskovému bodu ark.

sweepAngle float

Úhel v stupňoch sa meria časovo z startAngle’ parameter na dokončenie bodu oblúka.

Exceptions

ArgumentNullException

pen’ is null

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

Drží oblohu, ktorá predstavuje časť elipcie, ktorá je špecifikovaná pármi koordinátov, šírkou a výškou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl arku.

x int

x-koordinát horného ľavého rohu pravého rohu, ktorý definuje elips.

y int

Y-koordinát horného ľavého rohu pravého rohu, ktorý definuje elips.

width int

Šírka obdĺžnika, ktorý definuje elips.

height int

Výška pravého úhlu, ktorý definuje elips.

startAngle int

Uhol v stupňoch meraný hodinovo od x-axis k východiskovému bodu ark.

sweepAngle int

Úhel v stupňoch sa meria časovo z startAngle’ parameter na dokončenie bodu oblúka.

Exceptions

ArgumentNullException

pen’ is null.

DrawArc(Pen, rektangle, float, float)

Drží oblohu, ktorá predstavuje časť elliptu špecifikovanú Aspose.Imaging.Rectangle štruktúrou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl arku.

rect Rectangle

Aspose.Imaging.RectangleF štruktúra, ktorá definuje hranice elipsy.

startAngle float

Uhol v stupňoch meraný hodinovo od x-axis k východiskovému bodu ark.

sweepAngle float

Úhel v stupňoch sa meria časovo z startAngle’ parameter na dokončenie bodu oblúka.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Drží Bézier spline definované štyrmi objednanými párovmi koordinátov, ktoré predstavujú 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, ktorý určuje farbu, šírku a štýl krivky.

x1 float

x-koordinát východiskového bodu kurvy.

y1 float

Y-koordinát východiskového bodu kurvy.

x2 float

x-koordinát prvého kontrolného bodu kurvy.

y2 float

Y-koordinát prvé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 koncového bodu krivky.

y4 float

Y-koordinát koncového bodu krivky.

Exceptions

ArgumentNullException

pen’ is null.

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

Drží Bézier spline definované štyri Aspose.Imaging.PointF štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl krivky.

pt1 PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje východiskový bod kurvy.

pt2 PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje prvú kontrolnú bodku pre krivku.

pt3 PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje druhú kontrolnú bodku pre krivku.

pt4 PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje koniec bodu kurvy.

Exceptions

ArgumentNullException

pen’ is null.

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

Drží Bézier spline definované štyri Aspose.Imaging.Point štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen štruktúra, ktorá určuje farbu, šírku a štýl kurvy.

pt1 Point

Aspose.Imaging.bodová štruktúra, ktorá predstavuje východiskový bod kurvy.

pt2 Point

Aspose.Imaging.bodová štruktúra, ktorá predstavuje prvú kontrolnú bodku pre krivku.

pt3 Point

Aspose.Imaging.bodová štruktúra, ktorá predstavuje druhú kontrolnú bodku pre krivku.

pt4 Point

Aspose.Imaging.bodová štruktúra, ktorá predstavuje koniec bodu kurvy.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Odstrániť sériu Bézier splines z radu Aspose.Imaging.Point štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl krivky.

points Point []

Nariadenie Aspose.Imaging.Punktové štruktúry, ktoré predstavujú body určujúce krivku.

Exceptions

ArgumentNullException

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

DrawBeziers(Počítač, PointF[])

Odstrániť sériu Bézier splines z radu Aspose.Imaging.PointF štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl krivky.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré predstavujú body určujúce krivku.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Počítač, PointF[])

Drží uzavretú kardinálnu spline definovanú sériou štruktúr Aspose.Imaging.PointF. Táto metóda používa predvolený napätie 0,5 a W L17.FillMode.Alternate režim vyplnenia.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Počítač, PointF[], a float)

Drží uzavretú kardinálnu spline definovanú sériou Aspose.Imaging.PointF štruktúr pomocou špecifikovaného napätia. Táto metóda používa predvolený režim plnenia _www.fillmode.Alternate.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

DrawClosedCurve(Pôda, bod[])

Drží uzavretú kardinálnu spline definovanú sériou Aspose.Imaging.Point štruktúr. Táto metóda používa predvolený napätie 0,5 a W L17.FillMode.Alternate režim vyplnenia.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

Exceptions

ArgumentNullException

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

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

Drží uzavretú kardinálnu spline definovanú radom Aspose.Imaging.Point štruktúry pomocou špecifikovaného napätia. Táto metóda používa predvolený režim plnenia _www.FillMode.Alternate.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Počítač, PointF[])

Drží kardinálovú spline cez špecifikovaný rad štruktúr Aspose.Imaging.PointF. Táto metóda používa predvolené napätie 0.5.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

Exceptions

ArgumentNullException

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

DrawCurve(Počítač, PointF[], a float)

Vytiahne kardinálovú spline cez špecifikovaný rad štruktúr Aspose.Imaging.PointF pomocou špecifického napätia.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré predstavujú body definujúce krivku.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Počítač, PointF[], int , int)

Drží kardinálovú spline cez špecifikovanú radu Aspose.Imaging.PointF štruktúr.Táto metóda používa predvolené napätie 0,5.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

offset int

Odstráňte z prvého prvku v poradí parametra bodov na východiskový bod v kurve.

numberOfSegments int

Počet segmentov po počiatočnom bodu, ktorý sa má zahrnúť do kurva.

Exceptions

ArgumentNullException

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

DrawCurve(Počítač, PointF[], int , int , float)

Drží kardinálovú spline cez špecifikovaný rad Aspose.Imaging.PointF štruktúr pomocou špecifického napätia.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

offset int

Odstráňte z prvého prvku v poradí parametra bodov na východiskový bod v kurve.

numberOfSegments int

Počet segmentov po počiatočnom bodu, ktorý sa má zahrnúť do kurva.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Pôda, bod[])

Vytiahne kardinálovú spline cez špecifikovaný rad Aspose.Imaging.Point štruktúr.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Vytiahne kardinálovú spline cez špecifikovaný rad Aspose.Imaging.Point štruktúr pomocou špecifického napätia.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

DrawCurve(Pôda, bod[], int , int , float)

Vytiahne kardinálovú spline cez špecifikovaný rad Aspose.Imaging.Point štruktúr pomocou špecifického napätia.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a výšku kurvy.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

offset int

Odstráňte z prvého prvku v poradí parametra bodov na východiskový bod v kurve.

numberOfSegments int

Počet segmentov po počiatočnom bodu, ktorý sa má zahrnúť do kurva.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

DrawEllipse(Pôvodný názov: Rectangle)

Drží elliptu definovanú obmedzujúcou Aspose.Imaging.RectangleF.

public void DrawEllipse(Pen pen, RectangleF rect)

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl elipsy.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá definuje hranice elipsy.

Exceptions

ArgumentNullException

pen’ is null.

DrawEllipse(Pláž, pláž, pláž, pláž)

Drží ellipsu definovanú obdĺžnikom určeným párom koordinátov, výškou a šírkou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl elipsy.

x float

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

y float

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

width float

Šírka hraničného obdĺžnika, ktorý definuje elips.

height float

Výška obdĺžnika, ktorý definuje elips.

Exceptions

ArgumentNullException

pen’ is null.

DrawEllipse(Pen, rektangulár)

Drží ellipsu špecifikovanú hraničnou štruktúrou Aspose.Imaging.Rectangle.

public void DrawEllipse(Pen pen, Rectangle rect)

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl elipsy.

rect Rectangle

Aspose.Imaging.Rectangle štruktúra, ktorá definuje hranice elipsy.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

//Creates an instance of FileStream
                                                                                                                                                                                                                                                                using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                    //Create an instance of PngOptions and set its various properties
                                                                                                                                                                                                                                                                    Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();

                                                                                                                                                                                                                                                                    //Set the Source for PngOptions
                                                                                                                                                                                                                                                                    pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);

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

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

                                                                                                                                                                                                                                                                        //Draw an Arc by specifying the Pen object having Black color, 
                                                                                                                                                                                                                                                                        //a Rectangle surrounding the Arc, Start Angle and Sweep Angle
                                                                                                                                                                                                                                                                        graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);

                                                                                                                                                                                                                                                                        //Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
                                                                                                                                                                                                                                                                        graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));

                                                                                                                                                                                                                                                                        //Draw a Curve by specifying the Pen object having Green color and an array of Points
                                                                                                                                                                                                                                                                        graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });

                                                                                                                                                                                                                                                                        //Draw an Ellipse using the Pen object and a surrounding Rectangle
                                                                                                                                                                                                                                                                        graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));

                                                                                                                                                                                                                                                                        //Draw a Line 
                                                                                                                                                                                                                                                                        graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));

                                                                                                                                                                                                                                                                        //Draw a Pie segment
                                                                                                                                                                                                                                                                        graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);

                                                                                                                                                                                                                                                                        //Draw a Polygon by specifying the Pen object having Red color and an array of Points
                                                                                                                                                                                                                                                                        graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });

                                                                                                                                                                                                                                                                        //Draw a Rectangle
                                                                                                                                                                                                                                                                        graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));

                                                                                                                                                                                                                                                                        //Create a SolidBrush object and set its various properties
                                                                                                                                                                                                                                                                        Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
                                                                                                                                                                                                                                                                        brush.Color = Color.Purple;
                                                                                                                                                                                                                                                                        brush.Opacity = 100;

                                                                                                                                                                                                                                                                        //Draw a String using the SolidBrush object and Font, at specific Point
                                                                                                                                                                                                                                                                        graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));

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

Exceptions

ArgumentNullException

pen’ is null.

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

Drží ellipsu definovanú obdĺžnikom určeným párom koordinátov, výškou a šírkou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl elipsy.

x int

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

y int

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

width int

Šírka hraničného obdĺžnika, ktorý definuje elips.

height int

Výška obdĺžnika, ktorý definuje elips.

Exceptions

ArgumentNullException

pen’ is null.

DrawImage(Obrázok, PointF)

Zobraziť špecifikovaný Aspose.Imaging.Graphics.Image, pomocou jeho pôvodnej fyzickej veľkosti, na určenom mieste.

public void DrawImage(Image sourceImage, PointF point)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

point PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje horný ľavý uhol natáčaného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, float, float)

Zobraziť špecifikovaný Aspose.Imaging.Graphics.Image, pomocou jeho pôvodnej fyzickej veľkosti, na určenom mieste.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

x float

x-koordinát horného ľavého rohu vytiahnutého obrazu.

y float

Y-koordinát horného ľavého rohu vytiahnutého obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, RectangleF)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

public void DrawImage(Image sourceImage, RectangleF rect)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá špecifikuje umiestnenie a veľkosť natáčaného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, Rectangle, Graphics)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectDestination Rectangle

Cieľový rektangul.

graphicsUnit GraphicsUnit

Grafická jednotka .

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(obrázok, RectangleF, GraphicsUnit)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectDestination RectangleF

Cieľový rektangul.

graphicsUnit GraphicsUnit

Grafická jednotka .

Exceptions

ArgumentNullException

sourceImage’ is null.

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

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectDestination Rectangle

Cieľový rektangul.

graphicsUnit GraphicsUnit

Grafická jednotka .

imageAttributes ImageAttributes

Obrázok má atribúty.

Exceptions

ArgumentNullException

sourceImage’ is null.

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

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectDestination RectangleF

Účelový rektangul, ktorý sa má vytiahnuť.

graphicsUnit GraphicsUnit

Grafická jednotka .

imageAttributes ImageAttributes

Obrázok má atribúty.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, rektangle, rektangle, grafika)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectSource Rectangle

Príslušný pravý zdroj.

rectDestination Rectangle

Účelom je rektum.

graphicsUnit GraphicsUnit

Grafická jednotka .

Exceptions

ArgumentNullException

sourceImage’ is null.

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

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectSource RectangleF

Príslušný pravý zdroj.

rectDestination RectangleF

Účelom je rektum.

graphicsUnit GraphicsUnit

Grafická jednotka .

Exceptions

ArgumentNullException

sourceImage’ is null.

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

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectSource Rectangle

Príslušný pravý zdroj.

rectDestination Rectangle

Účelom je rektum.

graphicsUnit GraphicsUnit

Grafická jednotka .

imageAttributes ImageAttributes

Obrázok má atribúty.

Exceptions

ArgumentNullException

sourceImage’ is null.

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

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rectSource RectangleF

Pôvodný rektangul.

rectDestination RectangleF

Cieľový rektangul.

graphicsUnit GraphicsUnit

Grafická jednotka na použitie.

imageAttributes ImageAttributes

Obrázok je určený na použitie.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, bod[])

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints Point []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

DrawImage(Obrázok, bod[], rectangle)

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints Point []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

srcRect Rectangle

Pôvodný rektangul.

DrawImage(Obrázok, bod[], Rectangle , GraphicsUnit)

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints Point []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

srcRect Rectangle

Pôvodný rektangul.

srcUnit GraphicsUnit

jednotky na meranie.

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

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints Point []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

srcRect Rectangle

Pôvodný rektangul.

srcUnit GraphicsUnit

jednotky na meranie.

imageAttributes ImageAttributes

Obrázok má atribúty.

DrawImage(Obrázok, PointF[])

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints PointF []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

Exceptions

ArgumentNullException

obrázok

DrawImage(Obrázok, PointF[], RectangleF)

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints PointF []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

srcRect RectangleF

Pôvodný rektangul.

DrawImage(Obrázok, PointF[], RectangleF, GraphicsUnit)

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints PointF []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

srcRect RectangleF

Pôvodný rektangul.

srcUnit GraphicsUnit

jednotky na meranie.

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

Odstráňte špecifikovanú časť špecifikovaného image’ na špecifikovanom mieste a s špecifikovanou veľkosťou.

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

Parameters

image Image

Obrázok sa má natáčať.

destPoints PointF []

Zariadenie troch PointF štruktúr, ktoré definujú paralelogram.

srcRect RectangleF

Pôvodný rektangul.

srcUnit GraphicsUnit

jednotky na meranie.

imageAttributes ImageAttributes

Obrázok má atribúty.

DrawImage(Obrázok, flotila, flotila, flotila)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

x float

x-koordinát horného ľavého rohu vytiahnutého obrazu.

y float

Y-koordinát horného ľavého rohu vytiahnutého obrazu.

width float

Rozsah natáčaného obrazu.

height float

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

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, bod)

Zobraziť špecifikovaný Aspose.Imaging.Graphics.Image, pomocou jeho pôvodnej fyzickej veľkosti, na určenom mieste.

public void DrawImage(Image sourceImage, Point point)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

point Point

Aspose.Imaging.bodová štruktúra, ktorá predstavuje umiestnenie horného ľavého rohu natáčaného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, int, int)

Odstráňte špecifikovaný obrázok pomocou jeho pôvodnej fyzickej veľkosti na mieste, ktoré určuje koordinátový pár.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

x int

x-koordinát horného ľavého rohu vytiahnutého obrazu.

y int

Y-koordinát horného ľavého rohu vytiahnutého obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, rectangle)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

public void DrawImage(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rect Rectangle

Aspose.Imaging.Rectangle štruktúra, ktorá určuje umiestnenie a veľkosť natáčaného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImage(Obrázok, int, int, int, int)

Zobraziť špecifikovanú Aspose.Imaging.Graphics.Image na špecifickej lokalite a s určenou veľkosťou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

x int

x-koordinát horného ľavého rohu vytiahnutého obrazu.

y int

Y-koordinát horného ľavého rohu vytiahnutého obrazu.

width int

Rozsah natáčaného obrazu.

height int

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

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Obrázok, bod)

Zobraziť špecifikovaný obrázok pomocou jeho pôvodnej fyzickej veľkosti na špecifikovanom mieste.

public void DrawImageUnscaled(Image sourceImage, Point point)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

point Point

Aspose.Imaging.bodová štruktúra, ktorá špecifikuje horný ľavý rohož odrezaného obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Obrázok, int, int)

Zobraziť špecifikovaný obrázok pomocou jeho pôvodnej fyzickej veľkosti na umiestnení špecifikované koordinátovou párou.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

x int

x-koordinát horného ľavého rohu vytiahnutého obrazu.

y int

Y-koordinát horného ľavého rohu vytiahnutého obrazu.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Obrázok, rectangle)

Zobraziť špecifikovaný obrázok pomocou jeho pôvodnej fyzickej veľkosti na špecifikovanom mieste.

public void DrawImageUnscaled(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rect Rectangle

Aspose.Imaging.Rectangle, ktorý špecifikuje horný ľavý uhol vytiahnutého obrazu. X a Y vlastnosti rektanglu špecificujú horný leviak. Šírka a výška sa ignorujú.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaled(Obrázok, int, int, int, int)

Zobraziť špecifikovaný obrázok pomocou jeho pôvodnej fyzickej veľkosti na špecifikovanom mieste.

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

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

x int

x-koordinát horného ľavého rohu vytiahnutého obrazu.

y int

Y-koordinát horného ľavého rohu vytiahnutého obrazu.

width int

Parametre sa nepoužívajú.

height int

Parametre sa nepoužívajú.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawImageUnscaledAndClipped(Obrázok, rectangle)

Odstráňte špecifikovaný obrázok bez skalovania a v prípade potreby ho nakreslite tak, aby sa zhodoval v špecifikovanom pravom rohu.

public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

Obrázok, s ktorým sa má nakresliť.

rect Rectangle

Aspose.Imaging.Rectangle, v ktorom môžete vytlačiť obrázok.

Exceptions

ArgumentNullException

sourceImage’ is null.

DrawLine(bod, bod, bod)

Sťahuje riadok, ktorý spája dve Aspose.Imaging.Point štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl línie.

point1 Point

Aspose.Imaging.Punková štruktúra, ktorá predstavuje prvú bodu na pripojenie.

point2 Point

Aspose.Imaging.Punktová štruktúra, ktorá predstavuje druhú bodu na pripojenie.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Sťahuje linku, ktorá spája dve Aspose.Imaging.PointF štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl línie.

point1 PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje prvú bodu na pripojenie.

point2 PointF

Aspose.Imaging.PointF štruktúra, ktorá predstavuje druhú bodu na pripojenie.

Exceptions

ArgumentNullException

pen’ is null.

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

Vytvára linku, ktorá spája dve body určené koordinátnymi pármi.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl línie.

x1 int

Koordinát x prvého bodu.

y1 int

Koordinát prvého bodu.

x2 int

X-koordinát druhého bodu

y2 int

Zhodnotenie bodu II.

Exceptions

ArgumentNullException

pen’ is null.

DrawLine(Pláž, pláž, pláž, pláž)

Vytvára linku, ktorá spája dve body určené koordinátnymi pármi.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl línie.

x1 float

Koordinát x prvého bodu.

y1 float

Koordinát prvého bodu.

x2 float

X-koordinát druhého bodu

y2 float

Zhodnotenie bodu II.

Exceptions

ArgumentNullException

pen’ is null.

DrawLines(Pôda, bod[])

Sťahuje sériu čiarových segmentov, ktoré spájajú rad štruktúr Aspose.Imaging.Point.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl segmentov línie.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré predstavujú body na pripojenie.

Exceptions

ArgumentNullException

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

ArgumentException

Rozsah bodov obsahuje menej ako 2 body.

DrawLines(Počítač, PointF[])

Sťahuje sériu čiarových segmentov, ktoré spájajú rad štruktúr Aspose.Imaging.PointF.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl segmentov línie.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré predstavujú body na pripojenie.

Exceptions

ArgumentNullException

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

ArgumentException

Rozsah bodov obsahuje menej ako 2 body.

DrawPath(Pôda, GraphicsPath)

Zobrazuje sa Aspose.Imaging.GraphicsPath.

public void DrawPath(Pen pen, GraphicsPath path)

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl cesty.

path GraphicsPath

Aspose.Imaging.GraphicsPath na kreslenie.

Examples

Tieto príklady používajú triedu GraphicsPath a Grafika na vytvorenie a manipuláciu s Čísla na obrazovej povrchu. Príklad vytvára novú Obrázok (typu Tiff), vyčistí povrch a vytiahne cesty pomocou triedy grafika.

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

Vráti tvar piesa definovaný elipciou špecifikovanou štruktúrou Aspose.Imaging.RectangleF a dvoma rádiálnymi líniami.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl tvaru pie.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá predstavuje obdĺžnik, ktorý definuje ellipsu, z ktorej pochádza tvar pie.

startAngle float

Úhel meraný v stupňoch hodinovej zóny od x-axis na prvú stranu tvaru pie.

sweepAngle float

Úhel meraný v stupňoch časovej vrstvy od parametra startAngle’ na druhej strane tvaru pie.

Exceptions

ArgumentNullException

pen’ is null.

DrawPie(Penia, flotila, flotila, flotila, flotila, flotila)

Drží tvar piese definovaný ellipsou špecifikovanou koordinátnou párou, šírkou, výškou a dvoma radiálnymi líniami.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl tvaru pie.

x float

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej pochádza tvar piesku.

y float

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza tvar piesku.

width float

Šírka obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza tvar piesku.

height float

Výška obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza tvar piesku.

startAngle float

Úhel meraný v stupňoch hodinovej zóny od x-axis na prvú stranu tvaru pie.

sweepAngle float

Úhel meraný v stupňoch časovej vrstvy od parametra startAngle’ na druhej strane tvaru pie.

Exceptions

ArgumentNullException

pen’ is null.

DrawPie(Pen, rektangle, float, float)

Vráti tvar piesa definovaný elipciou špecifikovanou Aspose.Imaging.Rectangle štruktúrou a dvoma rádiálnymi líniami.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl tvaru pie.

rect Rectangle

WL17_.Rectangle štruktúra, ktorá predstavuje obmedzujúci rektangol, ktorý definuje ellipsu, z ktorej prichádza tvar pie.

startAngle float

Úhel meraný v stupňoch hodinovej zóny od x-axis na prvú stranu tvaru pie.

sweepAngle float

Úhel meraný v stupňoch časovej vrstvy od parametra startAngle’ na druhej strane tvaru pie.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

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

Drží tvar piese definovaný ellipsou špecifikovanou koordinátnou párou, šírkou, výškou a dvoma radiálnymi líniami.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl tvaru pie.

x int

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej pochádza tvar piesku.

y int

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza tvar piesku.

width int

Šírka obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza tvar piesku.

height int

Výška obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza tvar piesku.

startAngle int

Úhel meraný v stupňoch hodinovej zóny od x-axis na prvú stranu tvaru pie.

sweepAngle int

Úhel meraný v stupňoch časovej vrstvy od parametra startAngle’ na druhej strane tvaru pie.

Exceptions

ArgumentNullException

pen’ is null.

DrawPolygon(Počítač, PointF[])

Drží polygón definovaný radom Aspose.Imaging.PointF štruktúr.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl polygónu.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré predstavujú vertikály polygónu.

Exceptions

ArgumentNullException

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

DrawPolygon(Pôda, bod[])

Drží polygón definovaný radom Aspose.Imaging.Point štruktúr.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl polygónu.

points Point []

Zariadenie Aspose.Imaging.Punktové štruktúry, ktoré predstavujú vertikály polygónu.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

//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(Pôvodný názov: Rectangle)

Sťahuje rektangul špecifikovaný štruktúrou Aspose.Imaging.RectangleF.

public void DrawRectangle(Pen pen, RectangleF rect)

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl rektálu.

rect RectangleF

Struktúra Aspose.Imaging.RectangleF, ktorá predstavuje rektangol na vytlačenie.

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangle(Pen, rektangulár)

Sťahuje rektangul špecifikovaný Aspose.Imaging.Rectangle štruktúra.

public void DrawRectangle(Pen pen, Rectangle rect)

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl rektálu.

rect Rectangle

Aspose.Imaging.Rectangle štruktúra, ktorá predstavuje rektangol na vytlačenie.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

//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(Pláž, pláž, pláž, pláž)

Drží rektangol, ktorý je určený koordinátnou párou, šírkou a výškou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl rektálu.

x float

x-koordinát horného ľavého rohu pravého rohu na výkres.

y float

Y-koordinát vrchného ľavého rohu pravého rohu na vytlačenie.

width float

Šírka pravého úhlu na vytiahnutie.

height float

Výška pravého úhlu na vytiahnutie.

Exceptions

ArgumentNullException

pen’ is null.

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

Drží rektangol, ktorý je určený koordinátnou párou, šírkou a výškou.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl rektálu.

x int

x-koordinát horného ľavého rohu pravého rohu na výkres.

y int

Y-koordinát vrchného ľavého rohu pravého rohu na vytlačenie.

width int

Šírka pravého úhlu na natáčanie.

height int

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

Exceptions

ArgumentNullException

pen’ is null.

DrawRectangles(Pôvodný názov: Rectangle[])

Sťahuje sériu rektangulov špecifikovaných Aspose.Imaging.RectangleF štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl výtlačkov rektálov.

rects RectangleF []

Nariadenie Aspose.Imaging.RectangleF štruktúry, ktoré predstavujú rektály na vytlačenie.

Exceptions

ArgumentNullException

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

DrawRectangles(Pen, rektangulár[])

Sťahuje sériu rektangulov špecifikovaných Aspose.Imaging.Rectangle štruktúry.

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

Parameters

pen Pen

Aspose.Imaging.Pen, ktorý určuje farbu, šírku a štýl výtlačkov rektálov.

rects Rectangle []

Zariadenie Aspose.Imaging.Rectangle štruktúry, ktoré predstavujú rektangly na vytlačenie.

Examples

Tento príklad ukazuje vytvorenie a používanie Pen objektov. Príklad vytvára nový obrázok a kresli rektangly 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(prúžok, Font, Brush, float, float)

Odstráňte špecifikovaný textový prúžok na špecifickej polohe specifikovanými objektmi Aspose.Imaging.Brush a Wl17.Font.

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

Parameters

s string

String na natáčanie.

font Font

Aspose.Imaging.Font, ktorý definuje textový formát riadku.

brush Brush

Aspose.Imaging.Brush, ktorý určuje farbu a textúru kresleného textu.

x float

x-koordinát horného ľavého rohu vytiahnutého textu.

y float

Y-koordinát horného ľavého rohu vytiahnutého textu.

Exceptions

ArgumentNullException

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

DrawString(String, Font, Brush a PointF)

Odstráňte špecifikovaný textový prúžok na špecifickej polohe specifikovanými objektmi Aspose.Imaging.Brush a Wl17.Font.

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

Parameters

s string

String na natáčanie.

font Font

Aspose.Imaging.Font, ktorý definuje textový formát riadku.

brush Brush

Aspose.Imaging.Brush, ktorý určuje farbu a textúru kresleného textu.

point PointF

Aspose.Imaging.PointF štruktúra, ktorá špecifikuje horný ľavý rohož vytlačeného textu.

Examples

Tento príklad používa triedu Graphics na vytvorenie primitívnych tvarov na povrchu obrazu. Na preukázanie operácie, vzor vytvára nový obrázok vo formáte PNG a natáča primitívne tvary na obrazovej ploche pomocou metód natáčania vystavených triedy Graffics

//Creates an instance of FileStream
                                                                                                                                                                                                                                                                using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                    //Create an instance of PngOptions and set its various properties
                                                                                                                                                                                                                                                                    Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();

                                                                                                                                                                                                                                                                    //Set the Source for PngOptions
                                                                                                                                                                                                                                                                    pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);

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

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

                                                                                                                                                                                                                                                                        //Draw an Arc by specifying the Pen object having Black color, 
                                                                                                                                                                                                                                                                        //a Rectangle surrounding the Arc, Start Angle and Sweep Angle
                                                                                                                                                                                                                                                                        graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);

                                                                                                                                                                                                                                                                        //Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
                                                                                                                                                                                                                                                                        graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));

                                                                                                                                                                                                                                                                        //Draw a Curve by specifying the Pen object having Green color and an array of Points
                                                                                                                                                                                                                                                                        graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });

                                                                                                                                                                                                                                                                        //Draw an Ellipse using the Pen object and a surrounding Rectangle
                                                                                                                                                                                                                                                                        graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));

                                                                                                                                                                                                                                                                        //Draw a Line 
                                                                                                                                                                                                                                                                        graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));

                                                                                                                                                                                                                                                                        //Draw a Pie segment
                                                                                                                                                                                                                                                                        graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);

                                                                                                                                                                                                                                                                        //Draw a Polygon by specifying the Pen object having Red color and an array of Points
                                                                                                                                                                                                                                                                        graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });

                                                                                                                                                                                                                                                                        //Draw a Rectangle
                                                                                                                                                                                                                                                                        graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));

                                                                                                                                                                                                                                                                        //Create a SolidBrush object and set its various properties
                                                                                                                                                                                                                                                                        Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
                                                                                                                                                                                                                                                                        brush.Color = Color.Purple;
                                                                                                                                                                                                                                                                        brush.Opacity = 100;

                                                                                                                                                                                                                                                                        //Draw a String using the SolidBrush object and Font, at specific Point
                                                                                                                                                                                                                                                                        graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));

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

Exceptions

ArgumentNullException

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

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

Odstráňte špecifikovaný textový prúžok v špecifickej polohe s konkrétnymi objektmi Aspose.Imaging.Brush a Wl17.Font pomocou formátovacích atribútov konkrétneho __ WL16__ .StringFormat.

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

Parameters

s string

String na natáčanie.

font Font

Aspose.Imaging.Font, ktorý definuje textový formát riadku.

brush Brush

Aspose.Imaging.Brush, ktorý určuje farbu a textúru kresleného textu.

x float

x-koordinát horného ľavého rohu vytiahnutého textu.

y float

Y-koordinát horného ľavého rohu vytiahnutého textu.

format StringFormat

Aspose.Imaging.StringFormat, ktorý špecifikuje formátovanie atribútov, ako je line spacing a alignment, ktoré sa vzťahujú na kreslený text.

Exceptions

ArgumentNullException

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

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

Odstráňte špecifikovaný textový prúžok v špecifickej polohe s konkrétnymi objektmi Aspose.Imaging.Brush a Wl17.Font pomocou formátovacích atribútov konkrétneho __ WL16__ .StringFormat.

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

Parameters

s string

String na natáčanie.

font Font

Aspose.Imaging.Font, ktorý definuje textový formát riadku.

brush Brush

Aspose.Imaging.Brush, ktorý určuje farbu a textúru kresleného textu.

point PointF

Aspose.Imaging.PointF štruktúra, ktorá špecifikuje horný ľavý rohož vytlačeného textu.

format StringFormat

Aspose.Imaging.StringFormat, ktorý špecifikuje formátovanie atribútov, ako je line spacing a alignment, ktoré sa vzťahujú na kreslený text.

Exceptions

ArgumentNullException

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

DrawString(String, Font, Brush, RectangleF)

Odstráňte špecifikovaný textový prúžok v určenom rektáloch s špecifickými objektmi Aspose.Imaging.Brush a W L17.Font.

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

Parameters

s string

String na natáčanie.

font Font

Aspose.Imaging.Font, ktorý definuje textový formát riadku.

brush Brush

Aspose.Imaging.Brush, ktorý určuje farbu a textúru kresleného textu.

layoutRectangle RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá určuje umiestnenie kresleného textu.

Exceptions

ArgumentNullException

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

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

Odstráňte špecifikovaný textový prúžok v špecifickom pravom rohu s konkrétnymi objektmi Aspose.Imaging.Brush a W L 17.Font pomocou formátovacích atribútov konkrétneho __ WL 17 _.StringFormat.

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

Parameters

s string

String na natáčanie.

font Font

Aspose.Imaging.Font, ktorý definuje textový formát riadku.

brush Brush

Aspose.Imaging.Brush, ktorý určuje farbu a textúru kresleného textu.

layoutRectangle RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá určuje umiestnenie kresleného textu.

format StringFormat

Aspose.Imaging.StringFormat, ktorý špecifikuje formátovanie atribútov, ako je line spacing a alignment, ktoré sa vzťahujú na kreslený text.

Exceptions

ArgumentNullException

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

EndUpdate()

Dokončí caching grafických operácií, ktoré sa začali po zavolaní BeginUpdate. Predchádzajúce grafické operácie budú aplikované naraz pri zavolaní tejto metódy.

public void EndUpdate()

FillClosedCurve(Príslušenstvo, PointF[])

Vyplňuje vnútorný kryt uzavretého kardinálneho spline definovaný radom Aspose.Imaging.PointF štruktúr. Táto metóda používa predvolený napätie 0,5 a W L17.FillMode.Alternate režim vyplnenia.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

Exceptions

ArgumentNullException

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

FillClosedCurve(Príslušenstvo, PointF[], a FillMode)

Vyplní interiér uzavretého kardinálneho spline kurva definovaného radom Aspose.Imaging.PointF štruktúr pomocou špecifikovaného režimu vyplnenia. Táto metóda používa predvolené napätie 0.5.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

fillMode FillMode

Člen zoznamu Aspose.Imaging.FillMode, ktorý určuje, ako je kurva vyplnená.

Exceptions

ArgumentNullException

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

FillClosedCurve(Príslušenstvo, PointF[], FillMode , Float)

Vyplní interiér uzavretého kardinálneho spline kurva definovaného radom Aspose.Imaging.PointF štruktúr pomocou špecifikovaného režimu plnenia a napätia.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré definujú spline.

fillmode FillMode

Člen zoznamu Aspose.Imaging.FillMode, ktorý určuje, ako je kurva vyplnená.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

FillClosedCurve(Brúska, bod[])

Vyplňuje vnútorný kryt uzavretého kardinálneho spline definovaný radom Aspose.Imaging.Point štruktúry. Táto metóda používa predvolený napätie 0,5 a W L17.FillMode.Alternate režim vyplnenia.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

Exceptions

ArgumentNullException

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

FillClosedCurve(Brúska, bod[], a FillMode)

Vyplní interiér uzavretého kardinálneho spline kurva definovaného radom Aspose.Imaging.Point štruktúry pomocou špecifikovaného režimu vyplnenia. Táto metóda používa predvolené napätie 0.5.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

fillmode FillMode

Člen zoznamu Aspose.Imaging.FillMode, ktorý určuje, ako je kurva vyplnená.

Exceptions

ArgumentNullException

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

FillClosedCurve(Brúska, bod[], FillMode , Float)

Vyplní interiér uzavretého kardinálneho spline kurva definovaného radom Aspose.Imaging.Point štruktúry pomocou špecifikovaného režimu plnenia a napätia.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points Point []

Nariadenie Aspose.Imaging.bodové štruktúry, ktoré definujú spline.

fillmode FillMode

Člen zoznamu Aspose.Imaging.FillMode, ktorý určuje, ako je kurva vyplnená.

tension float

Hodnota väčšia ako alebo rovná sa 0,0F, ktorá určuje napätie kurvy.

Exceptions

ArgumentNullException

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

FillEllipse(Brúska, RectangleF)

Vyplňuje vnútorný elips definovaný obmedzujúcim rektanglom špecifikovaným štruktúrou Aspose.Imaging.RectangleF.

public void FillEllipse(Brush brush, RectangleF rect)

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá predstavuje obdĺžnik, ktorý definuje ellipsu.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Brúska, float, float, float, float)

Vyplňuje vnútorný elips definovaný obmedzujúcim rektanglom určeným párom koordinátov, šírkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

x float

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

y float

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

width float

Šírka hraničného obdĺžnika, ktorý definuje elips.

height float

Výška obdĺžnika, ktorý definuje elips.

Exceptions

ArgumentNullException

brush’ is null.

FillEllipse(Brúska, Rectangle)

Vyplňuje vnútorný elips definovaný obmedzujúcim rektanglom špecifikovaným Aspose.Imaging.Rectangle štruktúrou.

public void FillEllipse(Brush brush, Rectangle rect)

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rect Rectangle

Aspose.Imaging.Rectangle štruktúra, ktorá predstavuje obmedzujúci rektangol, ktorý definuje ellipsu.

Exceptions

ArgumentNullException

brush’ is null.

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

Vyplňuje vnútorný elips definovaný obmedzujúcim rektanglom určeným párom koordinátov, šírkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

x int

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

y int

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje elips.

width int

Šírka hraničného obdĺžnika, ktorý definuje elips.

height int

Výška obdĺžnika, ktorý definuje elips.

Exceptions

ArgumentNullException

brush’ is null.

FillPath(Príslušenstvo, GraphicsPath)

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

public void FillPath(Brush brush, GraphicsPath path)

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

path GraphicsPath

Aspose.Imaging.GraphicsPath, ktorý predstavuje cestu na vyplnenie.

Exceptions

ArgumentNullException

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

FillPie(Brúska, rektangle, float, float)

Vyplní vnútornú časť pásky definovanú elipciou špecifikovanou štruktúrou Aspose.Imaging.RectangleF a dvoma rádiálnymi líniami.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rect Rectangle

Aspose.Imaging.Rectangle štruktúra, ktorá predstavuje obmedzujúci rektangol, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

startAngle float

Úhlu v stupňoch merané hodinovo z x-axis na prvú stranu oddelenia pie.

sweepAngle float

Uhol v stupňoch meraný časovo z startAngle’ parameter na druhej strane sekcie pie.

Examples

Nasledujúci príklad ukazuje, ako skombinovať animovaný GIF obrázok z jednotlivých gIF blokov.

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(Brúska, RectangleF, float, float)

Vyplní vnútornú časť pásky definovanú elipciou špecifikovanou štruktúrou Aspose.Imaging.RectangleF a dvoma rádiálnymi líniami.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá predstavuje obdĺžnik, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

startAngle float

Úhlu v stupňoch merané hodinovo z x-axis na prvú stranu oddelenia pie.

sweepAngle float

Uhol v stupňoch meraný časovo z startAngle’ parameter na druhej strane sekcie pie.

Exceptions

ArgumentNullException

brush’ is null.

FillPie(Brúska, flotila, flotila, flotila, flotila, flotila)

Vyplňuje vnútornú časť pásky definovanú elipciou, ktorá je určená pármi koordinátov, šírkou, výškou a dvoma rádiálnymi líniami.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

x float

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

y float

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

width float

Šírka obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

height float

Výška obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

startAngle float

Úhlu v stupňoch merané hodinovo z x-axis na prvú stranu oddelenia pie.

sweepAngle float

Uhol v stupňoch meraný časovo z startAngle’ parameter na druhej strane sekcie pie.

Exceptions

ArgumentNullException

brush’ is null.

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

Vyplňuje vnútornú časť pásky definovanú elipciou, ktorá je určená pármi koordinátov, šírkou, výškou a dvoma rádiálnymi líniami.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

x int

x-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

y int

Y-koordinát horného ľavého rohu obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

width int

Šírka obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

height int

Výška obdĺžnika, ktorý definuje ellipsu, z ktorej prichádza oddiel pie.

startAngle int

Úhlu v stupňoch merané hodinovo z x-axis na prvú stranu oddelenia pie.

sweepAngle int

Uhol v stupňoch meraný časovo z startAngle’ parameter na druhej strane sekcie pie.

Exceptions

ArgumentNullException

brush’ is null.

FillPolygon(Príslušenstvo, PointF[])

Plní vnútorný polygón definovaný radom bodov, ktoré sú špecifikované Aspose.Imaging.PointF štruktúry a Wl17.FillMode.Alternate.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré predstavujú vrcholy polygónu na vyplnenie.

Exceptions

ArgumentNullException

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

FillPolygon(Príslušenstvo, PointF[], a FillMode)

Vyplní vnútorný polygón definovaný radom bodov špecifikovaných Aspose.Imaging.PointF štruktúry pomocou špecifického režimu plnenia.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points PointF []

Nariadenie Aspose.Imaging.PointF štruktúry, ktoré predstavujú vrcholy polygónu na vyplnenie.

fillMode FillMode

Člen zoznamu Aspose.Imaging.FillMode, ktorý určuje štýl plnenia.

Exceptions

ArgumentNullException

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

FillPolygon(Brúska, bod[])

Vyplňuje vnútorný polygón definovaný radom bodov špecifikovaných Aspose.Imaging.bodovými štruktúrami a W L17.FillMode.Alternate.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points Point []

Zariadenie Aspose.Imaging.Punktové štruktúry, ktoré predstavujú vrcholy polygónu na vyplnenie.

Exceptions

ArgumentNullException

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

FillPolygon(Brúska, bod[], a FillMode)

Vyplní vnútorný polygón definovaný radom bodov špecifikovaných Aspose.Imaging.bodové štruktúry pomocou špecifického režimu vyplnenia.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

points Point []

Zariadenie Aspose.Imaging.Punktové štruktúry, ktoré predstavujú vrcholy polygónu na vyplnenie.

fillMode FillMode

Člen zoznamu Aspose.Imaging.FillMode, ktorý určuje štýl plnenia.

Exceptions

ArgumentNullException

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

FillRectangle(Brúska, Rectangle)

Vyplňuje vnútorný obdĺžnik špecifikovaný Aspose.Imaging.Rectangle štruktúra.

public void FillRectangle(Brush brush, Rectangle rect)

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rect Rectangle

Aspose.Imaging.Rectangle štruktúra, ktorá predstavuje rektanglu na vyplnenie.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Brúska, RectangleF)

Vyplňuje vnútorný obdĺžnik špecifikovaný štruktúrou Aspose.Imaging.RectangleF.

public void FillRectangle(Brush brush, RectangleF rect)

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rect RectangleF

Aspose.Imaging.RectangleF štruktúra, ktorá predstavuje rektangol na vyplnenie.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangle(Brúska, float, float, float, float)

Vyplňuje vnútorný obdĺžnik určený párom koordinátov, šírkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

x float

x-koordinát horného ľavého rohu pravého rohu na vyplnenie.

y float

Y-koordinát horného ľavého rohu rektálu na vyplnenie.

width float

Šírka pravého úhlu na vyplnenie.

height float

Výška pravého úhlu na vyplnenie.

Exceptions

ArgumentNullException

brush’ is null.

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

Vyplňuje vnútorný obdĺžnik určený párom koordinátov, šírkou a výškou.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

x int

x-koordinát horného ľavého rohu pravého rohu na vyplnenie.

y int

Y-koordinát horného ľavého rohu rektálu na vyplnenie.

width int

Šírka pravého úhlu na vyplnenie.

height int

Výška pravého úhlu na vyplnenie.

Exceptions

ArgumentNullException

brush’ is null.

FillRectangles(Brúska, Rectangle[])

Plní interiéry sérií rektangulov špecifikovaných Aspose.Imaging.Rectangle štruktúry.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rects Rectangle []

Zariadenie Aspose.Imaging.Rectangle štruktúry, ktoré predstavujú rektangly na vyplnenie.

Exceptions

ArgumentNullException

brush’ is null or rects’ is null.

FillRectangles(Brúska, RectangleF[])

Plní interiéry sérií rektangulov špecifikovaných Aspose.Imaging.RectangleF štruktúr.

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

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

rects RectangleF []

Zariadenie Aspose.Imaging.Rectangle štruktúry, ktoré predstavujú rektangly na vyplnenie.

Exceptions

ArgumentNullException

brush’ is null or rects’ is null.

FillRegion(Brush, región)

Vyplňuje vnútorný priestor Aspose.Imaging.Region.

public void FillRegion(Brush brush, Region region)

Parameters

brush Brush

Aspose.Imaging.Brush, ktorý určuje charakteristiky plnenia.

region Region

Aspose.Imaging.Region, ktorý predstavuje oblasť na vyplnenie.

Exceptions

ArgumentNullException

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

~Graphics()

protected ~Graphics()

MeasureString(String, Font, SizeF, Stringsformát)

Meria špecifikovaný textový riadok so špecifickými parametrami

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

Parameters

text string

Text na meranie.

font Font

písmo na meranie.

layoutArea SizeF

v oblasti layout.

stringFormat StringFormat

Formát striekačky .

Returns

SizeF

Veľkosť v pixeloch meraného textového prúdu

MultiplyTransform(Matrix)

Zväčšuje Aspose.Imaging.Matrix, ktorý predstavuje miestnu geometrickú transformáciu tejto Wl17.Grafika špecifikovaným _ WL18_ .Matrx predpísaním špecifického _ wl16_ _ matrix.

public void MultiplyTransform(Matrix matrix)

Parameters

matrix Matrix

Aspose.Imaging.Matrix, ktorou sa rozmnožuje geometrická transformácia.

MultiplyTransform(Matrix a MatrixOrder)

Zväčšuje Aspose.Imaging.Matrix, ktorý predstavuje lokálnu geometrickú transformáciu tejto Wl17.Grafika špecifikovaným _ WL16_ .Matrx v špecifickom poradí.

public void MultiplyTransform(Matrix matrix, MatrixOrder order)

Parameters

matrix Matrix

Aspose.Imaging.Matrix, ktorou sa rozmnožuje geometrická transformácia.

order MatrixOrder

A Aspose.Imaging.MatrixOrder, ktorý špecifikuje, v akom zmysle sa majú dva matrice množiť.

ResetTransform()

Obnoviť Aspose.Imaging.Graphics.Transformovať vlastnosť na identitu.

public void ResetTransform()

RotateTransform(flotila)

Rotuje lokálnu geometrickú transformáciu podľa stanoveného množstva.Táto metóda predchádza rotácii na transformáciu.

public void RotateTransform(float angle)

Parameters

angle float

Z hľadiska rotujúceho rohu.

RotateTransform(Námestie, MatrixOrder)

Rotuje lokálnu geometrickú transformáciu podľa špecifikovaného množstva v špecifikovanom poradí.

public void RotateTransform(float angle, MatrixOrder order)

Parameters

angle float

Z hľadiska rotujúceho rohu.

order MatrixOrder

A Aspose.Imaging.MatrixOrder, ktorý špecifikuje, či doplniť alebo prepínať rotačnú matriu.

ScaleTransform(Pláž, Pláž)

Šírite miestnu geometrickú transformáciu podľa stanovených množstiev.Táto metóda predviaže šíriacu matriu na transformáciu.

public void ScaleTransform(float sx, float sy)

Parameters

sx float

Množstvo, podľa ktorého sa skaluje transformácia v x-axovom smere.

sy float

Množstvo, podľa ktorého sa skaluje transformácia v smere y-axis.

ScaleTransform(plavba, plavba, MatrixOrder)

Rozmerať lokálnu geometrickú transformáciu podľa špecifikovaných množstiev v špecifikovanom poradí.

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

Parameters

sx float

Množstvo, podľa ktorého sa skaluje transformácia v x-axovom smere.

sy float

Množstvo, podľa ktorého sa skaluje transformácia v smere y-axis.

order MatrixOrder

A Aspose.Imaging.MatrixOrder, ktorý špecifikuje, či rozšíriť alebo predĺžiť skalujúcu matriu.

TranslateTransform(Pláž, Pláž)

Preklad miestnej geometrickej transformácie podľa špecifikovaných rozmerov. Táto metóda prepája preklad na transformáciu.

public void TranslateTransform(float dx, float dy)

Parameters

dx float

Hodnota prekladu v x.

dy float

Hodnota prekladu v y.

TranslateTransform(plavba, plavba, MatrixOrder)

Preklad lokálnej geometrickej transformácie podľa špecifikovaných rozmerov v špecifikovanom poradí.

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

Parameters

dx float

Hodnota prekladu v x.

dy float

Hodnota prekladu v y.

order MatrixOrder

Nariadenie (prepend alebo append), v ktorom sa uplatní preklad.

 Slovenčina