Class Graphics
Το όνομα: Aspose.Imaging Συγκέντρωση: Aspose.Imaging.dll (25.4.0)
Αντιπροσωπεύει τα γραφικά σύμφωνα με τον γραφικό κινητήρα που χρησιμοποιείται στην τρέχουσα συλλογή.
public sealed class Graphics
Inheritance
Κληρονομημένα μέλη
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Constructors
Graphics(Image)
Αρχίζει μια νέα περίπτωση της τάξης Aspose.Imaging.Graphics.
public Graphics(Image sourceImage)
Parameters
sourceImage
Image
Η εικόνα της πηγής.
Properties
Clip
Αποκτήστε ή τοποθετήστε την περιοχή clip.
public Region Clip { get; set; }
Αξία ιδιοκτησίας
CompositingQuality
Αποκτά ή ρυθμίζει την ποιότητα σύνθεσης.
public CompositingQuality CompositingQuality { get; set; }
Αξία ιδιοκτησίας
Dpix
Αποκτά την οριζόντια ανάλυση αυτού του Aspose.Imaging.Graphics.
public float DpiX { get; }
Αξία ιδιοκτησίας
ΝΤΠΙ
Αποκτά την κάθετη ανάλυση αυτού του Aspose.Imaging.Graphics.
public float DpiY { get; }
Αξία ιδιοκτησίας
Image
Να πάρει την εικόνα.
public Image Image { get; }
Αξία ιδιοκτησίας
InterpolationMode
Αποκτά ή ρυθμίζει τη λειτουργία διασποράς.
public InterpolationMode InterpolationMode { get; set; }
Αξία ιδιοκτησίας
IsInBeginUpdateCall
Αποκτά μια τιμή που υποδεικνύει εάν το γραφικό είναι στην κατάσταση κλήσης BeginUpdate.
public bool IsInBeginUpdateCall { get; }
Αξία ιδιοκτησίας
PageScale
Αποκτήστε ή ρυθμίστε την κλίμακα μεταξύ παγκόσμιων μονάδων και μονάδων σελίδας για αυτό το Aspose.Imaging.Graphics.
public float PageScale { get; set; }
Αξία ιδιοκτησίας
PageUnit
Αποκτήστε ή τοποθετήστε την μονάδα μέτρησης που χρησιμοποιείται για τις συντεταγμένες σελίδων σε αυτό το Aspose.Imaging.Graphics.
public GraphicsUnit PageUnit { get; set; }
Αξία ιδιοκτησίας
PaintableImageOptions
Αποκτά ή ρυθμίζει τις επιλογές εικόνας, που χρησιμοποιούνται για τη δημιουργία ζωγραφισμένων εικόνων vactor για να τραβήξετε.
public ImageOptionsBase PaintableImageOptions { get; set; }
Αξία ιδιοκτησίας
SmoothingMode
Αποκτά ή ρυθμίζει τη λειτουργία χαλάρωσης.
public SmoothingMode SmoothingMode { get; set; }
Αξία ιδιοκτησίας
TextRenderingHint
Αποκτά ή ρυθμίζει το κείμενο που δίνει έγγραφο.
public TextRenderingHint TextRenderingHint { get; set; }
Αξία ιδιοκτησίας
Transform
Αποκτά ή βάζει αντίγραφο της γεωμετρικής μεταμόρφωσης του κόσμου για αυτό το Aspose.Imaging.Graphics.
public Matrix Transform { get; set; }
Αξία ιδιοκτησίας
Methods
BeginUpdate()
Τα αποτελέσματα γραφικών που εφαρμόζονται στη συνέχεια δεν θα εφαρμόζονται αμέσως αντί για το EndUpdate θα προκαλέσει την εφαρμογή όλων των αποτελεσμάτων ταυτόχρονα.
public void BeginUpdate()
Remarks
Σημειώστε ότι τα αποτελέσματα μετά την κλήση του BeginUpdate δεν θα εφαρμοστεί σε περίπτωση που το EndUpdate δεν καλείται.
Clear(Color)
Καθαρίζει την επιφάνεια γραφικών χρησιμοποιώντας το καθορισμένο χρώμα.
public void Clear(Color color)
Parameters
color
Color
Το χρώμα για να καθαρίσει την επιφάνεια γραφικών.
Examples
Αυτά τα παραδείγματα χρησιμοποιούν την κατηγορία GraphicsPath και Graphics για να δημιουργήσουν και να χειραγωγήσουν Σημάδια σε μια επιφάνεια εικόνας. Το παράδειγμα δημιουργεί μια νέα εικόνα (του τύπου Tiff), καθαρίζει την επιφάνεια και τραβάει τα μονοπάτια με τη βοήθεια της κατηγορίας GraphicsPath. Στο τέλος, η μέθοδος DrawPath που εκτίθεται από την κατηγορία Graphics καλείται να κάνει τα μονοπάτια στην επιφάνεια.
//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
//Create an instance of TiffOptions and set its various properties
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
//Set the source for the instance of ImageOptions
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();
//Create an instance of Figure class
Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);
// save all changes.
image.Save();
}
}
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
DrawArc(Πεν, πλοίο, πλοίο, πλοίο, πλοίο, πλοίο, πλοίο)
Κλείνει ένα arc που αντιπροσωπεύει ένα κομμάτι ενός ελιπάσματος που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του arc.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του ορθογώνου που καθορίζει την ελίπωση.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του ορθογώνου που καθορίζει την ελίπωση.
width
float
Το πλάτος του ορθογώνου που καθορίζει την ελίτ.
height
float
Το ύψος του ορθογώνου που καθορίζει την ελίτ.
startAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-axis μέχρι το σημείο εκκίνησης του arc.
sweepAngle
float
Η γωνία σε βαθμούς μετρήθηκε από το startAngle’ παράμετρο για να τελειώσει το σημείο του arc.
Exceptions
pen’ is null.
DrawArc(Πεν, RectangleF, πλωτό, πλωτό)
Κλείνει ένα arc που αντιπροσωπεύει ένα κομμάτι ενός ελιπάσματος που καθορίζεται από μια δομή Aspose.Imaging.RectangleF.
public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του arc.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που καθορίζει τα όρια της ελίτ.
startAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-axis μέχρι το σημείο εκκίνησης του arc.
sweepAngle
float
Η γωνία σε βαθμούς μετρήθηκε από το startAngle’ παράμετρο για να τελειώσει το σημείο του arc.
Exceptions
pen’ is null
DrawArc(Πεν, int, int, int, int, int, int)
Κλείνει ένα arc που αντιπροσωπεύει ένα κομμάτι ενός ελιπάσματος που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του arc.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του ορθογώνου που καθορίζει την ελίπωση.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του ορθογώνου που καθορίζει την ελίπωση.
width
int
Το πλάτος του ορθογώνου που καθορίζει την ελίτ.
height
int
Το ύψος του ορθογώνου που καθορίζει την ελίτ.
startAngle
int
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-axis μέχρι το σημείο εκκίνησης του arc.
sweepAngle
int
Η γωνία σε βαθμούς μετρήθηκε από το startAngle’ παράμετρο για να τελειώσει το σημείο του arc.
Exceptions
pen’ is null.
DrawArc(Πίνακας, Πίνακας, Πίνακας)
Κλείνει ένα arc που αντιπροσωπεύει ένα κομμάτι ενός ελιπάσματος που καθορίζεται από μια δομή Aspose.Imaging.Rectangle.
public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του arc.
rect
Rectangle
Aspose.Imaging.RectangleF δομή που καθορίζει τα όρια της ελίτ.
startAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-axis μέχρι το σημείο εκκίνησης του arc.
sweepAngle
float
Η γωνία σε βαθμούς μετρήθηκε από το startAngle’ παράμετρο για να τελειώσει το σημείο του arc.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawBezier(πλοία, πλοία, πλοία, πλοία, πλοία, πλοία, πλοία, πλοία)
Δοκιμάζει μια γραμμή Bézier που ορίζεται από τέσσερα παραγγελθέντα ζεύγη συντονισμών που αντιπροσωπεύουν σημεία.
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 που καθορίζει το χρώμα, το πλάτος και το στυλ της καμπύλης.
x1
float
Ο συντονιστής x του σημείου εκκίνησης της καμπύλης.
y1
float
Ο συντονισμός του σημείου εκκίνησης της καμπύλης.
x2
float
Ο συντονιστής x του πρώτου σημείου ελέγχου της καμπύλης.
y2
float
Ο συντονιστής y του πρώτου σημείου ελέγχου της καμπύλης.
x3
float
Ο συντονιστής x του δεύτερου σημείου ελέγχου της καμπύλης.
y3
float
Ο συντονιστής y του δεύτερου σημείου ελέγχου της καμπύλης.
x4
float
Ο συντονιστής x του τελικού σημείου της καμπύλης.
y4
float
Ο συντονιστής του τελικού σημείου της καμπύλης.
Exceptions
pen’ is null.
DrawBezier(Πεν, PointF, PointF, PointF και PointF)
Σχεδιάζει μια γραμμή Bézier που ορίζεται από τέσσερις δομές Aspose.Imaging.PointF.
public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της καμπύλης.
pt1
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει το σημείο εκκίνησης της καμπύλης.
pt2
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει το πρώτο σημείο ελέγχου για την καμπύλη.
pt3
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει το δεύτερο σημείο ελέγχου για την καμπύλη.
pt4
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει το τελικό σημείο της καμπύλης.
Exceptions
pen’ is null.
DrawBezier(Πόντος, Πόντος, Πόντος, Πόντος)
Σχεδιάζει μια γραμμή Bézier που ορίζεται από τέσσερις δομές Aspose.Imaging.Point.
public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
Parameters
pen
Pen
Aspose.Imaging.Pen δομή που καθορίζει το χρώμα, το πλάτος και το στυλ της καμπύλης.
pt1
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει το σημείο εκκίνησης της καμπύλης.
pt2
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει το πρώτο σημείο ελέγχου για την καμπύλη.
pt3
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει το δεύτερο σημείο ελέγχου για την καμπύλη.
pt4
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει το τελικό σημείο της καμπύλης.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawBeziers(Πεν, Πόντο[])
Φέρνει μια σειρά από Bézier σπλίνες από μια σειρά από δομές Aspose.Imaging.Point.
public void DrawBeziers(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της καμπύλης.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που αντιπροσωπεύουν τα σημεία που καθορίζουν την καμπύλη.
Exceptions
pen’ is null.-or-
points’ is null.
DrawBeziers(Πεν, PointF[])
Φέρνει μια σειρά από Bézier σπλίνες από μια σειρά από δομές Aspose.Imaging.PointF.
public void DrawBeziers(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που αντιπροσωπεύουν τα σημεία που καθορίζουν την καμπύλη.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Πεν, PointF[])
Χρησιμοποιεί μια κλειστή καρδινική γραμμή που ορίζεται από μια σειρά από δομές Aspose.Imaging.PointF. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη τάση του 0.5 και Aspose.Imaging.FillMode.Alternate λειτουργία συμπλήρωσης.
public void DrawClosedCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Πεν, PointF[ ]Πλοία)
Δοκιμάζει μια κλειστή καρδινική γραμμή που ορίζεται από μια σειρά από δομές Aspose.Imaging.PointF χρησιμοποιώντας μια καθορισμένη τάση. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη μορφή συμπλήρωσης Aspose.Imaging.FillMode.Alternate.
public void DrawClosedCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Πεν, Πόντο[])
Χρησιμοποιεί μια κλειστή καρδινική γραμμή που ορίζεται από μια σειρά από δομές Aspose.Imaging.Point. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη τάση του 0.5 και Aspose.Imaging.FillMode.Alternate λειτουργία συμπλήρωσης.
public void DrawClosedCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
Exceptions
pen’ is null.-or-
points’ is null.
DrawClosedCurve(Πεν, Πόντο[ ]Πλοία)
Δοκιμάζει μια κλειστή καρδινική γραμμή που ορίζεται από μια σειρά από δομές Aspose.Imaging.Point χρησιμοποιώντας μια καθορισμένη τάση. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη μορφή συμπλήρωσης Aspose.Imaging.FillMode.Alternate.
public void DrawClosedCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, PointF[])
Δοκιμάζει μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.PointF. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη τάση 0.5.
public void DrawCurve(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, PointF[ ]Πλοία)
Δοκιμάστε μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.PointF χρησιμοποιώντας μια καθορισμένη τάση.
public void DrawCurve(Pen pen, PointF[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που αντιπροσωπεύουν τα σημεία που καθορίζουν την καμπύλη.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, PointF[ ]Ιντ, Ιντ)
Δοκιμάστε μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.PointF. Το σχέδιο ξεκινά από την αρχή της γραμμής.Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη τάση 0.5.
public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
offset
int
Αποσυνδεθείτε από το πρώτο στοιχείο στη σειρά των παραμέτρων point’ στο σημείο εκκίνησης στην καμπύλη.
numberOfSegments
int
Ο αριθμός των τμημάτων μετά το σημείο εκκίνησης που πρέπει να συμπεριληφθεί στην καμπύλη.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, PointF[ ], int , int , float)
Δοκιμάστε μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.PointF χρησιμοποιώντας μια καθορισμένη τάση.
public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
offset
int
Αποσυνδεθείτε από το πρώτο στοιχείο στη σειρά των παραμέτρων point’ στο σημείο εκκίνησης στην καμπύλη.
numberOfSegments
int
Ο αριθμός των τμημάτων μετά το σημείο εκκίνησης που πρέπει να συμπεριληφθεί στην καμπύλη.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, Πόντο[])
Δοκιμάστε μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.Point.
public void DrawCurve(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, Πόντο[ ]Πλοία)
Δοκιμάστε μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.Point χρησιμοποιώντας μια καθορισμένη τάση.
public void DrawCurve(Pen pen, Point[] points, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(Πεν, Πόντο[ ], int , int , float)
Δοκιμάστε μια καρδινική γραμμή μέσα από μια καθορισμένη σειρά δομών Aspose.Imaging.Point χρησιμοποιώντας μια καθορισμένη τάση.
public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το ύψος της καμπύλης.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
offset
int
Αποσυνδεθείτε από το πρώτο στοιχείο στη σειρά των παραμέτρων point’ στο σημείο εκκίνησης στην καμπύλη.
numberOfSegments
int
Ο αριθμός των τμημάτων μετά το σημείο εκκίνησης που πρέπει να συμπεριληφθεί στην καμπύλη.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
pen’ is null.-or-
points’ is null.
DrawEllipse(Πεν, RectangleF)
Εμφανίζει μια ελίτ που ορίζεται από ένα συνδετικό Aspose.Imaging.RectangleF.
public void DrawEllipse(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ελίτ.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που καθορίζει τα όρια της ελίτ.
Exceptions
pen’ is null.
DrawEllipse(Πεν, πλοίο, πλοίο, πλοίο, πλοίο)
Δράζει μια ελίπωση που ορίζεται από μια οριοθετημένη ορθογώνια που ορίζεται από ένα ζευγάρι συντονισμών, ένα ύψος και ένα πλάτος.
public void DrawEllipse(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ελίτ.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
width
float
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελίτ.
height
float
Το ύψος του δεξιού που ορίζει την ελίτ.
Exceptions
pen’ is null.
DrawEllipse(Πεν, Ρέκταγκελ)
Φτιάχνει μια ελίτ που καθορίζεται από μια συνδετική δομή Aspose.Imaging.Rectangle.
public void DrawEllipse(Pen pen, Rectangle rect)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ελίτ.
rect
Rectangle
Aspose.Imaging.Rectangle δομή που καθορίζει τα όρια της ελίτ.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawEllipse(Πεν, int, int, int, int)
Δράζει μια ελίπωση που ορίζεται από μια οριοθετημένη ορθογώνια που ορίζεται από ένα ζευγάρι συντονισμών, ένα ύψος και ένα πλάτος.
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ελίτ.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
width
int
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελίτ.
height
int
Το ύψος του δεξιού που ορίζει την ελίτ.
Exceptions
pen’ is null.
DrawImage(Φωτογραφία, PointF)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image, χρησιμοποιώντας το αρχικό φυσικό του μέγεθος, στην καθορισμένη τοποθεσία.
public void DrawImage(Image sourceImage, PointF point)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
point
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει την ανώτερη αριστερή γωνία της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, πλοία, πλοία)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image, χρησιμοποιώντας το αρχικό φυσικό του μέγεθος, στην καθορισμένη τοποθεσία.
public void DrawImage(Image sourceImage, float x, float y)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας της εικόνας.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, RectangleF)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, RectangleF rect)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που καθορίζει τη θέση και το μέγεθος της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, Rectangle, GraphicsUnit)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectDestination
Rectangle
Ο προορισμός κατευθείαν.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, RectangleF, GraphicsUnit)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectDestination
RectangleF
Ο προορισμός κατευθείαν.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, Rectangle, GraphicsUnit, ImageAttributes)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectDestination
Rectangle
Ο προορισμός κατευθείαν.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
imageAttributes
ImageAttributes
Τα χαρακτηριστικά της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, RectangleF, GraphicsUnit, ImageAttributes)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectDestination
RectangleF
Ο προορισμός κατώφλι για να τραβήξει.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
imageAttributes
ImageAttributes
Τα χαρακτηριστικά της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, Rectangle, GraphicsUnit)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectSource
Rectangle
Η πηγή του ορθού.
rectDestination
Rectangle
Ο προορισμός της αριστεράς.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, RectangleF, RectangleF, GraphicsUnit)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectSource
RectangleF
Η πηγή του ορθού.
rectDestination
RectangleF
Ο προορισμός της αριστεράς.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, Rectangle, Rectangle, GraphicsUnit, ImageAttributes)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectSource
Rectangle
Η πηγή του ορθού.
rectDestination
Rectangle
Ο προορισμός της αριστεράς.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών.
imageAttributes
ImageAttributes
Τα χαρακτηριστικά της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, RectangleF, RectangleF, GraphicsUnit, ImageAttributes)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rectSource
RectangleF
Η αριστερά της πηγής.
rectDestination
RectangleF
Ο προορισμός κατευθείαν.
graphicsUnit
GraphicsUnit
Η μονάδα γραφικών για χρήση.
imageAttributes
ImageAttributes
Η εικόνα αποδίδεται στη χρήση.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, σημείο[])
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, Point[] destPoints)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
Point
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
DrawImage(Φωτογραφία, σημείο[ ]Ακτινογώνιο)
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
Point
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
srcRect
Rectangle
Η αριστερά της πηγής.
DrawImage(Φωτογραφία, σημείο[ ]ΓΡΑΦΙΚΕΣ, ΓΡΑΦΙΚΕΣ)
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
Point
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
srcRect
Rectangle
Η αριστερά της πηγής.
srcUnit
GraphicsUnit
Οι μονάδες μέτρησης.
DrawImage(Φωτογραφία, σημείο[ ], Rectangle, GraphicsUnit, ImageAttributes)
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
Point
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
srcRect
Rectangle
Η αριστερά της πηγής.
srcUnit
GraphicsUnit
Οι μονάδες μέτρησης.
imageAttributes
ImageAttributes
Τα χαρακτηριστικά της εικόνας.
DrawImage(Φωτογραφία, PointF[])
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
PointF
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
Exceptions
Εικόνα
DrawImage(Φωτογραφία, PointF[ ]Ρέκτανγκλεφ)
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
PointF
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
srcRect
RectangleF
Η αριστερά της πηγής.
DrawImage(Φωτογραφία, PointF[ ], RectangleF, GraphicsUnit)
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
PointF
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
srcRect
RectangleF
Η αριστερά της πηγής.
srcUnit
GraphicsUnit
Οι μονάδες μέτρησης.
DrawImage(Φωτογραφία, PointF[ ], RectangleF, GraphicsUnit, ImageAttributes)
Φέρτε το καθορισμένο τμήμα της καθορισμένης image’ στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
Η εικόνα να τραβήξει.
destPoints
PointF
[ ]
Η σειρά των τριών δομών PointF που καθορίζουν ένα παράλληλο γράμμα.
srcRect
RectangleF
Η αριστερά της πηγής.
srcUnit
GraphicsUnit
Οι μονάδες μέτρησης.
imageAttributes
ImageAttributes
Τα χαρακτηριστικά της εικόνας.
DrawImage(Φωτογραφία, σκάφος, σκάφος, σκάφος, σκάφος)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, float x, float y, float width, float height)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας της εικόνας.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας της εικόνας.
width
float
Το πλάτος της εικόνας που τραβήχτηκε.
height
float
Το ύψος της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, σημείο)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image, χρησιμοποιώντας το αρχικό φυσικό του μέγεθος, στην καθορισμένη τοποθεσία.
public void DrawImage(Image sourceImage, Point point)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
point
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει τη θέση της ανώτερης αριστεράς γωνίας της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, int, int)
Φέρτε την καθορισμένη εικόνα, χρησιμοποιώντας το αρχικό φυσικό της μέγεθος, στην τοποθεσία που καθορίζεται από ένα ζευγάρι συντονιστών.
public void DrawImage(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας της εικόνας.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, Rectangle)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rect
Rectangle
Aspose.Imaging.Rectangle δομή που καθορίζει τη θέση και το μέγεθος της εικόνας.
Exceptions
sourceImage’ is null.
DrawImage(Φωτογραφία, int, int, int, int)
Φέρτε το καθορισμένο Aspose.Imaging.Graphics.Image στην καθορισμένη τοποθεσία και με το καθορισμένο μέγεθος.
public void DrawImage(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας της εικόνας.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας της εικόνας.
width
int
Το πλάτος της εικόνας που τραβήχτηκε.
height
int
Το ύψος της εικόνας.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Φωτογραφία, σημείο)
Φτιάχνει μια συγκεκριμένη εικόνα χρησιμοποιώντας το αρχικό φυσικό της μέγεθος σε μια συγκεκριμένη τοποθεσία.
public void DrawImageUnscaled(Image sourceImage, Point point)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
point
Point
Aspose.Imaging.Point δομή που προσδιορίζει την ανώτερη αριστερή γωνία της εικόνας.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Φωτογραφία, int, int)
Φέρτε την καθορισμένη εικόνα χρησιμοποιώντας το αρχικό φυσικό της μέγεθος στην τοποθεσία που καθορίζεται από ένα ζευγάρι συντονιστών.
public void DrawImageUnscaled(Image sourceImage, int x, int y)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας της εικόνας.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας της εικόνας.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Φωτογραφία, Rectangle)
Φτιάχνει μια συγκεκριμένη εικόνα χρησιμοποιώντας το αρχικό φυσικό της μέγεθος σε μια συγκεκριμένη τοποθεσία.
public void DrawImageUnscaled(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rect
Rectangle
Aspose.Imaging.Rectangle που προσδιορίζει την ανώτερη αριστερή γωνία της εικόνας. Οι ιδιότητες X και Y της ορθογώνης προσδιορίζουν την ανώτερη αριστερή γωνία. Οι ιδιότητες πλάτος και ύψος αγνοούνται.
Exceptions
sourceImage’ is null.
DrawImageUnscaled(Φωτογραφία, int, int, int, int)
Φτιάχνει μια συγκεκριμένη εικόνα χρησιμοποιώντας το αρχικό φυσικό της μέγεθος σε μια συγκεκριμένη τοποθεσία.
public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας της εικόνας.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας της εικόνας.
width
int
Το παράμετρο δεν χρησιμοποιείται.
height
int
Το παράμετρο δεν χρησιμοποιείται.
Exceptions
sourceImage’ is null.
DrawImageUnscaledAndClipped(Φωτογραφία, Rectangle)
Κλείνει την καθορισμένη εικόνα χωρίς κλίμακα και την κλιπώνει, εάν είναι απαραίτητο, για να ταιριάζει στην καθορισμένη ορθογώνια.
public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
Η εικόνα που πρέπει να τραβήξετε.
rect
Rectangle
Το Aspose.Imaging.Rectangle στο οποίο να τραβήξει την εικόνα.
Exceptions
sourceImage’ is null.
DrawLine(Πόντος, Πόντος, Πόντος)
Σχεδιάζει μια γραμμή που συνδέει δύο δομές Aspose.Imaging.Point.
public void DrawLine(Pen pen, Point point1, Point point2)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της γραμμής.
point1
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει το πρώτο σημείο για να συνδεθείτε.
point2
Point
Aspose.Imaging.Point δομή που αντιπροσωπεύει το δεύτερο σημείο για να συνδεθείτε.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawLine(Πεν, PointF και PointF)
Σχεδιάζει μια γραμμή που συνδέει δύο δομές Aspose.Imaging.PointF.
public void DrawLine(Pen pen, PointF point1, PointF point2)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της γραμμής.
point1
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει το πρώτο σημείο για να συνδεθείτε.
point2
PointF
Aspose.Imaging.PointF δομή που αντιπροσωπεύει το δεύτερο σημείο για να συνδεθείτε.
Exceptions
pen’ is null.
DrawLine(Πεν, int, int, int, int)
Κλείνει μια γραμμή που συνδέει τα δύο σημεία που καθορίζονται από τα ζεύγη συντονισμού.
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της γραμμής.
x1
int
Ο συντονιστής x του πρώτου σημείου.
y1
int
Ο συντονισμός του πρώτου σημείου.
x2
int
Ο συντονιστής x του δεύτερου σημείου.
y2
int
Ο συντονισμός του δεύτερου σημείου.
Exceptions
pen’ is null.
DrawLine(Πεν, πλοίο, πλοίο, πλοίο, πλοίο)
Κλείνει μια γραμμή που συνδέει τα δύο σημεία που καθορίζονται από τα ζεύγη συντονισμού.
public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της γραμμής.
x1
float
Ο συντονιστής x του πρώτου σημείου.
y1
float
Ο συντονισμός του πρώτου σημείου.
x2
float
Ο συντονιστής x του δεύτερου σημείου.
y2
float
Ο συντονισμός του δεύτερου σημείου.
Exceptions
pen’ is null.
DrawLines(Πεν, Πόντο[])
Σχεδιάζει μια σειρά από τμήματα γραμμής που συνδέουν μια σειρά από δομές Aspose.Imaging.Point.
public void DrawLines(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ των τμημάτων γραμμής.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που αντιπροσωπεύουν τα σημεία για να συνδεθείτε.
Exceptions
pen’ is null.-or-
points’ is null.
Η σειρά points" περιέχει λιγότερο από 2 σημεία.
DrawLines(Πεν, PointF[])
Σχεδιάζει μια σειρά από τμήματα γραμμής που συνδέουν μια σειρά από δομές Aspose.Imaging.PointF.
public void DrawLines(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ των τμημάτων γραμμής.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που αντιπροσωπεύουν τα σημεία για να συνδεθείτε.
Exceptions
pen’ is null.-or-
points’ is null.
Η σειρά points" περιέχει λιγότερο από 2 σημεία.
DrawPath(ΓΡΑΦΙΚΕΣ, ΓΡΑΦΙΚΕΣ)
Εισάγετε ένα Aspose.Imaging.GraphicsPath.
public void DrawPath(Pen pen, GraphicsPath path)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του δρόμου.
path
GraphicsPath
Φωτογραφία - Φωτογραφία - Φωτογραφία - Φωτογραφία - Φωτογραφία - Φωτογραφία
Examples
Αυτά τα παραδείγματα χρησιμοποιούν την κατηγορία GraphicsPath και Graphics για να δημιουργήσουν και να χειραγωγήσουν Σημάδια σε μια επιφάνεια εικόνας. Το παράδειγμα δημιουργεί μια νέα εικόνα (του τύπου Tiff), καθαρίζει την επιφάνεια και τραβάει τα μονοπάτια με τη βοήθεια της κατηγορίας GraphicsPath. Στο τέλος, η μέθοδος DrawPath που εκτίθεται από την κατηγορία Graphics καλείται να κάνει τα μονοπάτια στην επιφάνεια.
//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
//Create an instance of TiffOptions and set its various properties
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
//Set the source for the instance of ImageOptions
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();
//Create an instance of Figure class
Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.-or-
path’ is null.
DrawPie(Πεν, RectangleF, πλωτό, πλωτό)
Σχεδιάζει μια μορφή πηγαίου που ορίζεται από μια ελίτ που καθορίζεται από μια δομή Aspose.Imaging.RectangleF και δύο ριζικές γραμμές.
public void DrawPie(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του σχήματος της πέρας.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που αντιπροσωπεύει το συνδετικό ορθόδοξο που καθορίζει την ελίπωση από την οποία προέρχεται η μορφή του πέους.
startAngle
float
Η γωνία μετρήθηκε σε βαθμούς χρονολογικά από το x-αξί μέχρι την πρώτη πλευρά της μορφής του πιάτου.
sweepAngle
float
Η γωνία μετρήθηκε σε βαθμούς ρολόγιας από την παραμέτρηση startAngle’ στην άλλη πλευρά της μορφής του πιάτου.
Exceptions
pen’ is null.
DrawPie(Πεν, πλοίο, πλοίο, πλοίο, πλοίο, πλοίο, πλοίο)
Δοκιμάζει μια μορφή πηγαίου που ορίζεται από μια ελίτ που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος, ένα ύψος και δύο ριζικές γραμμές.
public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του σχήματος της πέρας.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του συνδετικού ορθογώνου που καθορίζει την ελίπωση από την οποία προέρχεται η μορφή του πέους.
y
float
Το y-συντονισμένο της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση από την οποία προέρχεται η μορφή του πέους.
width
float
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελίτ από την οποία προέρχεται η μορφή του πέους.
height
float
Το ύψος του συνδετικού ορθογώνου που καθορίζει την ελίτ από την οποία προέρχεται η μορφή του πέους.
startAngle
float
Η γωνία μετρήθηκε σε βαθμούς χρονολογικά από το x-αξί μέχρι την πρώτη πλευρά της μορφής του πιάτου.
sweepAngle
float
Η γωνία μετρήθηκε σε βαθμούς ρολόγιας από την παραμέτρηση startAngle’ στην άλλη πλευρά της μορφής του πιάτου.
Exceptions
pen’ is null.
DrawPie(Πίνακας, Πίνακας, Πίνακας)
Σχεδιάζει μια μορφή πηγαίου που ορίζεται από μια ελίτ που καθορίζεται από μια δομή Aspose.Imaging.Rectangle και δύο ριζικές γραμμές.
public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του σχήματος της πέρας.
rect
Rectangle
Aspose.Imaging.Rectangle δομή που αντιπροσωπεύει το συνδετικό ορθογώνιο που καθορίζει την ελίπωση από την οποία προέρχεται η μορφή του πέους.
startAngle
float
Η γωνία μετρήθηκε σε βαθμούς χρονολογικά από το x-αξί μέχρι την πρώτη πλευρά της μορφής του πιάτου.
sweepAngle
float
Η γωνία μετρήθηκε σε βαθμούς ρολόγιας από την παραμέτρηση startAngle’ στην άλλη πλευρά της μορφής του πιάτου.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawPie(Πεν, int, int, int, int, int, int)
Δοκιμάζει μια μορφή πηγαίου που ορίζεται από μια ελίτ που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος, ένα ύψος και δύο ριζικές γραμμές.
public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του σχήματος της πέρας.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του συνδετικού ορθογώνου που καθορίζει την ελίπωση από την οποία προέρχεται η μορφή του πέους.
y
int
Το y-συντονισμένο της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση από την οποία προέρχεται η μορφή του πέους.
width
int
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελίτ από την οποία προέρχεται η μορφή του πέους.
height
int
Το ύψος του συνδετικού ορθογώνου που καθορίζει την ελίτ από την οποία προέρχεται η μορφή του πέους.
startAngle
int
Η γωνία μετρήθηκε σε βαθμούς χρονολογικά από το x-αξί μέχρι την πρώτη πλευρά της μορφής του πιάτου.
sweepAngle
int
Η γωνία μετρήθηκε σε βαθμούς ρολόγιας από την παραμέτρηση startAngle’ στην άλλη πλευρά της μορφής του πιάτου.
Exceptions
pen’ is null.
DrawPolygon(Πεν, PointF[])
Σχεδιάζει ένα πολυγόνο που ορίζεται από μια σειρά από δομές Aspose.Imaging.PointF.
public void DrawPolygon(Pen pen, PointF[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του πολυγώνου.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που αντιπροσωπεύουν τις άκρες του πολυγώνου.
Exceptions
pen’ is null.-or-
points’ is null.
DrawPolygon(Πεν, Πόντο[])
Σχεδιάζει ένα πολυγόνο που ορίζεται από μια σειρά από δομές Aspose.Imaging.Point.
public void DrawPolygon(Pen pen, Point[] points)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ του πολυγώνου.
points
Point
[ ]
Αρκετές δομές Aspose.Imaging.Point που αντιπροσωπεύουν τις άκρες του πολυγώνου.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawRectangle(Πεν, RectangleF)
Δράζει μια ορθογώνια που καθορίζεται από μια δομή Aspose.Imaging.RectangleF.
public void DrawRectangle(Pen pen, RectangleF rect)
Parameters
pen
Pen
Ένα Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ορθογώνης.
rect
RectangleF
Μια δομή Aspose.Imaging.RectangleF που αντιπροσωπεύει την ορθογώνια για να τραβήξει.
Exceptions
pen’ is null.
DrawRectangle(Πεν, Ρέκταγκελ)
Δράζει μια ορθογώνια που καθορίζεται από μια δομή Aspose.Imaging.Rectangle.
public void DrawRectangle(Pen pen, Rectangle rect)
Parameters
pen
Pen
Ένα Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ορθογώνης.
rect
Rectangle
Μια δομή Aspose.Imaging.Rectangle που αντιπροσωπεύει την ορθογώνια για να τραβήξει.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
pen’ is null.
DrawRectangle(Πεν, πλοίο, πλοίο, πλοίο, πλοίο)
Κλείνει μια ορθογώνια που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void DrawRectangle(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Ένα Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ορθογώνης.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του ορθογώνου για να τραβήξει.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του ορθογώνου για να τραβήξει.
width
float
Το πλάτος της ορθογώνης για να τραβήξει.
height
float
Το ύψος της ορθογώνης για να τραβήξει.
Exceptions
pen’ is null.
DrawRectangle(Πεν, int, int, int, int)
Κλείνει μια ορθογώνια που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ της ορθογώνης.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του ορθογώνου για να τραβήξει.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του ορθογώνου για να τραβήξει.
width
int
Το πλάτος της ορθογώνης για να τραβήξει.
height
int
Το ύψος της ορθογώνης για να τραβήξει.
Exceptions
pen’ is null.
DrawRectangles(Πεν, RectangleF[])
Σχεδιάζει μια σειρά ορθογώνων που καθορίζονται από τις δομές Aspose.Imaging.RectangleF.
public void DrawRectangles(Pen pen, RectangleF[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ των γραμμών των ορθογώνων.
rects
RectangleF
[ ]
Αρκετές δομές Aspose.Imaging.RectangleF που αντιπροσωπεύουν τους ορθογώνους για να τραβήξει.
Exceptions
pen’ is null.-or-
rects’ is null.
DrawRectangles(Πεν, Ρέκταγκελ[])
Σχεδιάζει μια σειρά ορθογώνων που καθορίζονται από τις δομές Aspose.Imaging.Rectangle.
public void DrawRectangles(Pen pen, Rectangle[] rects)
Parameters
pen
Pen
Aspose.Imaging.Pen που καθορίζει το χρώμα, το πλάτος και το στυλ των γραμμών των ορθογώνων.
rects
Rectangle
[ ]
Αριθμός Aspose.Imaging.Rectangle δομές που αντιπροσωπεύουν τους ορθογώνους για να τραβήξει.
Examples
Αυτό το παράδειγμα δείχνει τη δημιουργία και τη χρήση των αντικειμένων Πεν. Το παράδειγμα δημιουργεί μια νέα εικόνα και ζωγραφίζει Rectangles στην επιφάνεια της εικόνας.
//Create an instance of BmpOptions and set its various properties
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
//Second Boolean parameter determines if the file to be created IsTemporal or not
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Create an instance of Image at specified Path
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Create an instance of Graphics and initialize it with Image object
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear the Graphics sutface with White Color
graphics.Clear(Aspose.Imaging.Color.White);
//Create an instance of Pen with color Red and width 5
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//Create an instance of HatchBrush and set its properties
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Create an instance of Pen
//initialize it with HatchBrush object and width
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(pen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
});
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(brusedpen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
});
// save all changes.
image.Save();
}
Exceptions
pen’ is null.-or-
rects’ is null.
DrawString(Σύνδεσμος, Font, Brush, Float, Float)
Συσκευάστε την καθορισμένη γραμμή κειμένου στην καθορισμένη θέση με τα καθορισμένα αντικείμενα Aspose.Imaging.Brush και Aspose.Imaging.Font.
public void DrawString(string s, Font font, Brush brush, float x, float y)
Parameters
s
string
Δυσκολεύεται να τραβήξει.
font
Font
Aspose.Imaging.Font που καθορίζει τη μορφή κειμένου της γραμμής.
brush
Brush
Aspose.Imaging.Brush που καθορίζει το χρώμα και τη δομή του κειμένου.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του κειμένου.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του κειμένου.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Σύνδεσμος, Font, Brush, PointF)
Συσκευάστε την καθορισμένη γραμμή κειμένου στην καθορισμένη θέση με τα καθορισμένα αντικείμενα Aspose.Imaging.Brush και Aspose.Imaging.Font.
public void DrawString(string s, Font font, Brush brush, PointF point)
Parameters
s
string
Δυσκολεύεται να τραβήξει.
font
Font
Aspose.Imaging.Font που καθορίζει τη μορφή κειμένου της γραμμής.
brush
Brush
Aspose.Imaging.Brush που καθορίζει το χρώμα και τη δομή του κειμένου.
point
PointF
Aspose.Imaging.PointF δομή που προσδιορίζει την ανώτερη αριστερή γωνία του κειμένου.
Examples
Αυτό το παράδειγμα χρησιμοποιεί την κατηγορία γραφικών για να δημιουργήσει πρωτόγονα σχήματα στην επιφάνεια της εικόνας. Για να αποδείξει τη λειτουργία, το παράδειγμα δημιουργεί μια νέα εικόνα σε μορφή PNG και ζωγραφίζει πρωτόγονα σχήματα στην επιφάνεια της εικόνας χρησιμοποιώντας τις μεθόδους ζωγραφικής που εκθέτει η κατηγορία γραφικών
//Creates an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.png", System.IO.FileMode.Create))
{
//Create an instance of PngOptions and set its various properties
Aspose.Imaging.ImageOptions.PngOptions pngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
//Set the Source for PngOptions
pngOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(pngOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Aspose.Imaging.Color.Wheat);
//Draw an Arc by specifying the Pen object having Black color,
//a Rectangle surrounding the Arc, Start Angle and Sweep Angle
graphics.DrawArc(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), new Aspose.Imaging.Rectangle(200, 200, 100, 200), 0, 300);
//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.
graphics.DrawBezier(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Blue, 2), new Aspose.Imaging.Point(250, 100), new Aspose.Imaging.Point(300, 30), new Aspose.Imaging.Point(450, 100), new Aspose.Imaging.Point(235, 25));
//Draw a Curve by specifying the Pen object having Green color and an array of Points
graphics.DrawCurve(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Green, 2), new[] { new Aspose.Imaging.Point(100, 200), new Aspose.Imaging.Point(100, 350), new Aspose.Imaging.Point(200, 450) });
//Draw an Ellipse using the Pen object and a surrounding Rectangle
graphics.DrawEllipse(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Yellow, 2), new Aspose.Imaging.Rectangle(300, 300, 100, 100));
//Draw a Line
graphics.DrawLine(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Violet, 2), new Aspose.Imaging.Point(100, 100), new Aspose.Imaging.Point(200, 200));
//Draw a Pie segment
graphics.DrawPie(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Silver, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(200, 20), new Aspose.Imaging.Size(200, 200)), 0, 45);
//Draw a Polygon by specifying the Pen object having Red color and an array of Points
graphics.DrawPolygon(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 2), new[] { new Aspose.Imaging.Point(20, 100), new Aspose.Imaging.Point(20, 200), new Aspose.Imaging.Point(220, 20) });
//Draw a Rectangle
graphics.DrawRectangle(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Orange, 2), new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(250, 250), new Aspose.Imaging.Size(100, 100)));
//Create a SolidBrush object and set its various properties
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush();
brush.Color = Color.Purple;
brush.Opacity = 100;
//Draw a String using the SolidBrush object and Font, at specific Point
graphics.DrawString("This image is created by Aspose.Imaging API", new Aspose.Imaging.Font("Times New Roman", 16), brush, new Aspose.Imaging.PointF(50, 400));
// save all changes.
image.Save();
}
}
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Σφραγίδα, Σφραγίδα, Σφραγίδα, Σφραγίδα, Σφραγίδα)
Συσκευάστε την καθορισμένη γραμμή κειμένου στην καθορισμένη θέση με τα καθορισμένα αντικείμενα Aspose.Imaging.Brush και Aspose.Imaging.Font χρησιμοποιώντας τα χαρακτηριστικά μορφοποίησης της καθορισμένης Aspose.Imaging.StringFormat.
public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format)
Parameters
s
string
Δυσκολεύεται να τραβήξει.
font
Font
Aspose.Imaging.Font που καθορίζει τη μορφή κειμένου της γραμμής.
brush
Brush
Aspose.Imaging.Brush που καθορίζει το χρώμα και τη δομή του κειμένου.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του κειμένου.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του κειμένου.
format
StringFormat
Aspose.Imaging.StringFormat που προσδιορίζει τα χαρακτηριστικά διαμόρφωσης, όπως η διαμόρφωση γραμμών και η ευθυγράμμιση, που εφαρμόζονται στο κείμενο που τραβήχτηκε.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Σύνδεσμος, Σύνδεσμος, Brush, PointF, StringFormat)
Συσκευάστε την καθορισμένη γραμμή κειμένου στην καθορισμένη θέση με τα καθορισμένα αντικείμενα Aspose.Imaging.Brush και Aspose.Imaging.Font χρησιμοποιώντας τα χαρακτηριστικά μορφοποίησης της καθορισμένης Aspose.Imaging.StringFormat.
public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)
Parameters
s
string
Δυσκολεύεται να τραβήξει.
font
Font
Aspose.Imaging.Font που καθορίζει τη μορφή κειμένου της γραμμής.
brush
Brush
Aspose.Imaging.Brush που καθορίζει το χρώμα και τη δομή του κειμένου.
point
PointF
Aspose.Imaging.PointF δομή που προσδιορίζει την ανώτερη αριστερή γωνία του κειμένου.
format
StringFormat
Aspose.Imaging.StringFormat που προσδιορίζει τα χαρακτηριστικά διαμόρφωσης, όπως η διαμόρφωση γραμμών και η ευθυγράμμιση, που εφαρμόζονται στο κείμενο που τραβήχτηκε.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Σύνδεσμος, Font, Brush, RectangleF)
Συσκευάστε την καθορισμένη γραμμή κειμένου στην καθορισμένη ορθογώνια με τα καθορισμένα αντικείμενα Aspose.Imaging.Brush και Aspose.Imaging.Font.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)
Parameters
s
string
Δυσκολεύεται να τραβήξει.
font
Font
Aspose.Imaging.Font που καθορίζει τη μορφή κειμένου της γραμμής.
brush
Brush
Aspose.Imaging.Brush που καθορίζει το χρώμα και τη δομή του κειμένου.
layoutRectangle
RectangleF
Aspose.Imaging.RectangleF δομή που καθορίζει τη θέση του κειμένου.
Exceptions
brush’ is null.-or-
s’ is null.
DrawString(Σύνδεσμος, Font, Brush, RectangleF, StringFormat)
Συσκευάστε την καθορισμένη γραμμή κειμένου στην καθορισμένη ορθογώνια με τα καθορισμένα αντικείμενα Aspose.Imaging.Brush και Aspose.Imaging.Font χρησιμοποιώντας τα χαρακτηριστικά μορφοποίησης της καθορισμένης Aspose.Imaging.StringFormat.
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
Parameters
s
string
Δυσκολεύεται να τραβήξει.
font
Font
Aspose.Imaging.Font που καθορίζει τη μορφή κειμένου της γραμμής.
brush
Brush
Aspose.Imaging.Brush που καθορίζει το χρώμα και τη δομή του κειμένου.
layoutRectangle
RectangleF
Aspose.Imaging.RectangleF δομή που καθορίζει τη θέση του κειμένου.
format
StringFormat
Aspose.Imaging.StringFormat που προσδιορίζει τα χαρακτηριστικά διαμόρφωσης, όπως η διαμόρφωση γραμμών και η ευθυγράμμιση, που εφαρμόζονται στο κείμενο που τραβήχτηκε.
Exceptions
brush’ is null.-or-
s’ is null.-or-
brush’ is null.
EndUpdate()
Ολοκληρώνεται η καταγραφή των λειτουργιών γραφικών που ξεκίνησαν μετά την κλήση BeginUpdate. Οι προηγούμενες λειτουργίες γραφικών θα εφαρμοστούν αμέσως κατά την κλήση αυτής της μεθόδου.
public void EndUpdate()
FillClosedCurve(Πυροσβεστική, PointF[])
Συμπληρώνει το εσωτερικό μιας κλειστής καρδινικής σφραγίδας που ορίζεται από μια σειρά από δομές Aspose.Imaging.PointF. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη τάση 0.5 και Aspose.Imaging.FillMode.Alternate λειτουργία συμπλήρωσης.
public void FillClosedCurve(Brush brush, PointF[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Πυροσβεστική, PointF[ ]Η FillMode)
Συμπληρώνει το εσωτερικό μιας κλειστής καρδινικής σφραγίδας που ορίζεται από μια σειρά από δομές Aspose.Imaging.PointF χρησιμοποιώντας την καθορισμένη λειτουργία συμπλήρωσης.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
fillMode
FillMode
Μέλος του καταλόγου Aspose.Imaging.FillMode που καθορίζει πώς συμπληρώνεται η καμπύλη.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Πυροσβεστική, PointF[ ], FillMode, πλωτή)
Συμπληρώνει το εσωτερικό μιας κλειστής καρδινικής σφραγίδας που ορίζεται από μια σειρά δομών Aspose.Imaging.PointF χρησιμοποιώντας την καθορισμένη λειτουργία συμπλήρωσης και την τάση.
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
Ένα Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του γεμίσματος.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που καθορίζουν τη γραμμή.
fillmode
FillMode
Μέλος του καταλόγου Aspose.Imaging.FillMode που καθορίζει πώς συμπληρώνεται η καμπύλη.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Σκουλήκια, Point[])
Συμπληρώνει το εσωτερικό μιας κλειστής καρδινικής σφραγίδας που ορίζεται από μια σειρά από δομές Aspose.Imaging.Point. Αυτή η μέθοδος χρησιμοποιεί μια προεπιλεγμένη τάση 0.5 και Aspose.Imaging.FillMode.Alternate λειτουργία συμπλήρωσης.
public void FillClosedCurve(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Σκουλήκια, Point[ ]Η FillMode)
Συμπληρώνει το εσωτερικό μιας κλειστής καρδινικής σφραγίδας που ορίζεται από μια σειρά από δομές Aspose.Imaging.Point χρησιμοποιώντας την καθορισμένη λειτουργία συμπλήρωσης.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
fillmode
FillMode
Μέλος του καταλόγου Aspose.Imaging.FillMode που καθορίζει πώς συμπληρώνεται η καμπύλη.
Exceptions
brush’ is null.-or-
points’ is null.
FillClosedCurve(Σκουλήκια, Point[ ], FillMode, πλωτή)
Συμπληρώνει το εσωτερικό μιας κλειστής καρδινικής σφραγίδας που ορίζεται από μια σειρά από δομές Aspose.Imaging.Point χρησιμοποιώντας την καθορισμένη λειτουργία συμπλήρωσης και την τάση.
public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
Point
[ ]
Μια σειρά από δομές Aspose.Imaging.Point που καθορίζουν τη γραμμή.
fillmode
FillMode
Μέλος του καταλόγου Aspose.Imaging.FillMode που καθορίζει πώς συμπληρώνεται η καμπύλη.
tension
float
Αξία μεγαλύτερη ή ίση με 0.0F που προσδιορίζει την τάση της καμπύλης.
Exceptions
brush’ is null.-or-
points’ is null.
FillEllipse(Σκουπίδια, RectangleF)
Συμπληρώνει το εσωτερικό ενός ελιπάσματος που ορίζεται από έναν δεξιό ορίζοντα που ορίζεται από μια δομή Aspose.Imaging.RectangleF.
public void FillEllipse(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που αντιπροσωπεύει το δεξιό όριο που καθορίζει την ελίτ.
Exceptions
brush’ is null.
FillEllipse(Σκουπίδια, Σκουπίδια, Σκουπίδια, Σκουπίδια)
Συμπληρώνει το εσωτερικό ενός ελιπάσματος που ορίζεται από ένα δεξιό ορίζοντα που ορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void FillEllipse(Brush brush, float x, float y, float width, float height)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
width
float
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελίτ.
height
float
Το ύψος του δεξιού που ορίζει την ελίτ.
Exceptions
brush’ is null.
FillEllipse(Σκουλήκια, Rectangle)
Συμπληρώνει το εσωτερικό ενός ελιπάσματος που ορίζεται από έναν δεξιό ορίζοντα που ορίζεται από μια δομή Aspose.Imaging.Rectangle.
public void FillEllipse(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rect
Rectangle
Aspose.Imaging.Rectangle δομή που αντιπροσωπεύει το συνδετικό ορθόδοξο που καθορίζει την ελίπωση.
Exceptions
brush’ is null.
FillEllipse(Μύθος, int, int, int, int)
Συμπληρώνει το εσωτερικό ενός ελιπάσματος που ορίζεται από ένα δεξιό ορίζοντα που ορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void FillEllipse(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση.
width
int
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελίτ.
height
int
Το ύψος του δεξιού που ορίζει την ελίτ.
Exceptions
brush’ is null.
FillPath(ΓΡΑΦΙΚΕΣ, ΓΡΑΦΙΚΕΣ)
Συμπληρώνει το εσωτερικό ενός Aspose.Imaging.GraphicsPath.
public void FillPath(Brush brush, GraphicsPath path)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
path
GraphicsPath
Aspose.Imaging.GraphicsPath που αντιπροσωπεύει το μονοπάτι για να γεμίσει.
Exceptions
brush’ is null.-or-
path’ is null.
FillPie(Σκουπίδια, Σκουπίδια, Σκουπίδια, Σκουπίδια)
Συμπληρώνει το εσωτερικό ενός τμήματος που ορίζεται από μια ελίτ που ορίζεται από μια δομή Aspose.Imaging.RectangleF και δύο ριζικές γραμμές.
public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rect
Rectangle
Aspose.Imaging.Rectangle δομή που αντιπροσωπεύει το συνδετικό ορθογώνιο που καθορίζει την ελίπωση από την οποία προέρχεται το τμήμα του πέους.
startAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-αξί μέχρι την πρώτη πλευρά του τμήματος του πέτρου.
sweepAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από την παραμέτρηση startAngle’ στην άλλη πλευρά του τμήματος pie.
Examples
Το παρακάτω παράδειγμα δείχνει πώς να συνθέσετε μια κινούμενη εικόνα GIF από μεμονωμένα μπλοκ GIF.
string dir = "c:\\temp\\";
// Create a GIF image 100 x 100 px.
// The first block is fully black by default.
using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
{
// The first circle is red
Aspose.Imaging.Brushes.SolidBrush brush1 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
// The second circle is black
Aspose.Imaging.Brushes.SolidBrush brush2 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);
// Gradually inscrease the angle of the red arc shape.
for (int angle = 10; angle <= 360; angle += 10)
{
Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
gr.FillPie(brush1, block.Bounds, 0, angle);
gifImage.AddBlock(block);
}
// Gradually inscrease the angle of the black arc and wipe out the red arc.
for (int angle = 10; angle <= 360; angle += 10)
{
Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
gr.FillPie(brush2, block.Bounds, 0, angle);
gr.FillPie(brush1, block.Bounds, angle, 360 - angle);
gifImage.AddBlock(block);
}
gifImage.Save(dir + "animated_radar.gif");
}
Exceptions
brush’ is null.
FillPie(Σκουπίδια, RectangleF, Float, Float)
Συμπληρώνει το εσωτερικό ενός τμήματος που ορίζεται από μια ελίτ που ορίζεται από μια δομή Aspose.Imaging.RectangleF και δύο ριζικές γραμμές.
public void FillPie(Brush brush, RectangleF rect, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που αντιπροσωπεύει το συνδετικό ορθογώνιο που καθορίζει την ελίπωση από την οποία προέρχεται το τμήμα του πέους.
startAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-αξί μέχρι την πρώτη πλευρά του τμήματος του πέτρου.
sweepAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από την παραμέτρηση startAngle’ στην άλλη πλευρά του τμήματος pie.
Exceptions
brush’ is null.
FillPie(Πλοία, πλοία, πλοία, πλοία, πλοία, πλοία)
Συμπληρώνει το εσωτερικό ενός τμήματος που καθορίζεται από μια ελίτ που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος, ένα ύψος και δύο ριζικές γραμμές.
public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση από την οποία προέρχεται το τμήμα του πέους.
y
float
Το y-συντονισμένο της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση από την οποία προέρχεται το τμήμα του πέους.
width
float
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελιπασία από την οποία προέρχεται το τμήμα του πέους.
height
float
Το ύψος του συνδετικού ορθογώνου που καθορίζει την ελίτ από την οποία προέρχεται το τμήμα του πέους.
startAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-αξί μέχρι την πρώτη πλευρά του τμήματος του πέτρου.
sweepAngle
float
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από την παραμέτρηση startAngle’ στην άλλη πλευρά του τμήματος pie.
Exceptions
brush’ is null.
FillPie(Βαθμός, int, int, int, int)
Συμπληρώνει το εσωτερικό ενός τμήματος που καθορίζεται από μια ελίτ που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος, ένα ύψος και δύο ριζικές γραμμές.
public void FillPie(Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση από την οποία προέρχεται το τμήμα του πέους.
y
int
Το y-συντονισμένο της ανώτερης αριστεράς γωνίας του δεξιού γωνίου που καθορίζει την ελίπωση από την οποία προέρχεται το τμήμα του πέους.
width
int
Το πλάτος του οριζόντιου ορθογώνου που καθορίζει την ελιπασία από την οποία προέρχεται το τμήμα του πέους.
height
int
Το ύψος του συνδετικού ορθογώνου που καθορίζει την ελίτ από την οποία προέρχεται το τμήμα του πέους.
startAngle
int
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από το x-αξί μέχρι την πρώτη πλευρά του τμήματος του πέτρου.
sweepAngle
int
Η γωνία σε βαθμούς μετρήθηκε με το ρολόι από την παραμέτρηση startAngle’ στην άλλη πλευρά του τμήματος pie.
Exceptions
brush’ is null.
FillPolygon(Πυροσβεστική, PointF[])
Γεμίζει το εσωτερικό ενός πολυγώνου που ορίζεται από μια σειρά σημείων που καθορίζονται από τις δομές Aspose.Imaging.PointF και Aspose.Imaging.FillMode.Alternate.
public void FillPolygon(Brush brush, PointF[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που αντιπροσωπεύουν τις άκρες του πολυγώνου για να γεμίσει.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Πυροσβεστική, PointF[ ]Η FillMode)
Συμπληρώνει το εσωτερικό ενός πολυγώνου που ορίζεται από μια σειρά σημείων που καθορίζονται από τις δομές Aspose.Imaging.PointF χρησιμοποιώντας την καθορισμένη λειτουργία συμπλήρωσης.
public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
PointF
[ ]
Μια σειρά από δομές Aspose.Imaging.PointF που αντιπροσωπεύουν τις άκρες του πολυγώνου για να γεμίσει.
fillMode
FillMode
Μέλος του καταλόγου Aspose.Imaging.FillMode που καθορίζει το στυλ του συμπληρώματος.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Σκουλήκια, Point[])
Συμπληρώνει το εσωτερικό ενός πολυγώνου που ορίζεται από μια σειρά σημείων που καθορίζονται από τις δομές Aspose.Imaging.Point και Aspose.Imaging.FillMode.Alternate.
public void FillPolygon(Brush brush, Point[] points)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
Point
[ ]
Μια σειρά από Aspose.Imaging.Point δομές που αντιπροσωπεύουν τις άκρες του πολυγώνου για να γεμίσει.
Exceptions
brush’ is null.-or-
points’ is null.
FillPolygon(Σκουλήκια, Point[ ]Η FillMode)
Συμπληρώνει το εσωτερικό ενός πολυγώνου που ορίζεται από μια σειρά σημείων που καθορίζονται από τις δομές Aspose.Imaging.Point χρησιμοποιώντας την καθορισμένη λειτουργία συμπλήρωσης.
public void FillPolygon(Brush brush, Point[] points, FillMode fillMode)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
points
Point
[ ]
Μια σειρά από Aspose.Imaging.Point δομές που αντιπροσωπεύουν τις άκρες του πολυγώνου για να γεμίσει.
fillMode
FillMode
Μέλος του καταλόγου Aspose.Imaging.FillMode που καθορίζει το στυλ του συμπληρώματος.
Exceptions
brush’ is null.-or-
points’ is null.
FillRectangle(Σκουλήκια, Rectangle)
Γεμίζει το εσωτερικό ενός ορθογώνου που καθορίζεται από μια δομή Aspose.Imaging.Rectangle.
public void FillRectangle(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rect
Rectangle
Aspose.Imaging.Rectangle δομή που αντιπροσωπεύει την ορθογώνια για να γεμίσει.
Exceptions
brush’ is null.
FillRectangle(Σκουπίδια, RectangleF)
Γεμίζει το εσωτερικό ενός ορθογώνου που καθορίζεται από μια δομή Aspose.Imaging.RectangleF.
public void FillRectangle(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rect
RectangleF
Aspose.Imaging.RectangleF δομή που αντιπροσωπεύει την ορθογώνια για να γεμίσει.
Exceptions
brush’ is null.
FillRectangle(Σκουπίδια, Σκουπίδια, Σκουπίδια, Σκουπίδια)
Γεμίζει το εσωτερικό ενός ορθογώνου που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void FillRectangle(Brush brush, float x, float y, float width, float height)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
x
float
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του ορθογώνου για να γεμίσει.
y
float
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του ορθογώνου για να γεμίσει.
width
float
Το πλάτος της ορθογώνης για να γεμίσει.
height
float
Το ύψος της ορθογώνης για να γεμίσει.
Exceptions
brush’ is null.
FillRectangle(Μύθος, int, int, int, int)
Γεμίζει το εσωτερικό ενός ορθογώνου που καθορίζεται από ένα ζευγάρι συντονισμών, ένα πλάτος και ένα ύψος.
public void FillRectangle(Brush brush, int x, int y, int width, int height)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
x
int
Ο συντονιστής x της ανώτερης αριστεράς γωνίας του ορθογώνου για να γεμίσει.
y
int
Ο συντονιστής y της ανώτερης αριστεράς γωνίας του ορθογώνου για να γεμίσει.
width
int
Το πλάτος της ορθογώνης για να γεμίσει.
height
int
Το ύψος της ορθογώνης για να γεμίσει.
Exceptions
brush’ is null.
FillRectangles(Σκουλήκια, Rectangle[])
Γεμίζει το εσωτερικό μιας σειράς ορθογώνων που καθορίζονται από τις δομές Aspose.Imaging.Rectangle.
public void FillRectangles(Brush brush, Rectangle[] rects)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rects
Rectangle
[ ]
Αριθμός Aspose.Imaging.Rectangle δομές που αντιπροσωπεύουν τις ορθόδοξες για να γεμίσει.
Exceptions
brush’ is null or
rects’ is null.
FillRectangles(Σκουπίδια, RectangleF[])
Γεμίζει το εσωτερικό μιας σειράς ορθογώνων που καθορίζονται από τις δομές Aspose.Imaging.RectangleF.
public void FillRectangles(Brush brush, RectangleF[] rects)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
rects
RectangleF
[ ]
Αριθμός Aspose.Imaging.Rectangle δομές που αντιπροσωπεύουν τις ορθόδοξες για να γεμίσει.
Exceptions
brush’ is null or
rects’ is null.
FillRegion(Brush, Περιφέρεια)
Συμπληρώνει το εσωτερικό ενός Aspose.Imaging.Region.
public void FillRegion(Brush brush, Region region)
Parameters
brush
Brush
Aspose.Imaging.Brush που καθορίζει τα χαρακτηριστικά του πληρώματος.
region
Region
Aspose.Imaging.περιοχή που αντιπροσωπεύει την περιοχή για να γεμίσει.
Exceptions
brush’ is null.-or-
region’ is null.
~Graphics()
protected ~Graphics()
MeasureString(Σύνδεσμος, Σύνδεσμος, SizeF, StringFormat)
Μετρήστε την καθορισμένη γραμμή κειμένου με καθορισμένες παραμέτρους
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameters
text
string
Το κείμενο για μέτρηση.
font
Font
Το γράμμα για μέτρηση.
layoutArea
SizeF
Η περιοχή του Layout.
stringFormat
StringFormat
Η μορφή του στυλ.
Returns
Μέγεθος σε pixels μετρημένης γραμμής κειμένου
MultiplyTransform(Matrix)
Πολλαπλασιάζει το Aspose.Imaging.Matrix που αντιπροσωπεύει την τοπική γεωμετρική μεταμόρφωση αυτού του Aspose.Imaging.Graphics από το καθορισμένο Aspose.Imaging.Matrix με την προδιάθεση του καθορισμένου Aspose.Imaging.Matrix.
public void MultiplyTransform(Matrix matrix)
Parameters
matrix
Matrix
Το Aspose.Imaging.Matrix με το οποίο να πολλαπλασιαστεί η γεωμετρική μεταμόρφωση.
MultiplyTransform(Ματρίκος, MatrixOrder)
Πολλαπλασιάζει το Aspose.Imaging.Matrix που αντιπροσωπεύει την τοπική γεωμετρική μεταμόρφωση αυτού του Aspose.Imaging.Graphics από το καθορισμένο Aspose.Imaging.Matrix στην καθορισμένη σειρά.
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
Το Aspose.Imaging.Matrix με το οποίο να πολλαπλασιαστεί η γεωμετρική μεταμόρφωση.
order
MatrixOrder
Ένα Aspose.Imaging.MatrixOrder που καθορίζει για ποιο σκοπό να πολλαπλασιαστούν οι δύο matrices.
ResetTransform()
Ανακαθιστά το Aspose.Imaging.Graphics.Transform property to identity.
public void ResetTransform()
RotateTransform(Πλοία)
Ρυθμίζει την τοπική γεωμετρική μεταμόρφωση με την καθορισμένη ποσότητα.Αυτή η μέθοδος προσαρμόζει την περιστροφή στην μεταμόρφωση.
public void RotateTransform(float angle)
Parameters
angle
float
Η γωνία της περιστροφής.
RotateTransform(Πυροβολισμοί, MatrixOrder)
Ρυθμίζει την τοπική γεωμετρική μεταμόρφωση με την καθορισμένη ποσότητα στην καθορισμένη σειρά.
public void RotateTransform(float angle, MatrixOrder order)
Parameters
angle
float
Η γωνία της περιστροφής.
order
MatrixOrder
Ένα Aspose.Imaging.MatrixOrder που καθορίζει αν πρέπει να προσθέσετε ή να προσαρμόσετε τη μητρώο περιστροφής.
ScaleTransform(Πλοία, Πλοία)
Μετρήστε την τοπική γεωμετρική μεταμόρφωση με τις καθορισμένες ποσότητες.Αυτή η μέθοδος δεσμεύει την κλίμακα με τη μεταμόρφωση.
public void ScaleTransform(float sx, float sy)
Parameters
sx
float
Η ποσότητα με την οποία να κλιμακώνονται οι μετασχηματισμοί στην κατεύθυνση του x-axis.
sy
float
Η ποσότητα με την οποία να κλιμακώνονται οι μετασχηματισμοί στην κατεύθυνση του y-axis.
ScaleTransform(Πλοία, Πλοία, MatrixOrder)
Μετρήστε την τοπική γεωμετρική μεταμόρφωση με τις καθορισμένες ποσότητες στην καθορισμένη σειρά.
public void ScaleTransform(float sx, float sy, MatrixOrder order)
Parameters
sx
float
Η ποσότητα με την οποία να κλιμακώνονται οι μετασχηματισμοί στην κατεύθυνση του x-axis.
sy
float
Η ποσότητα με την οποία να κλιμακώνονται οι μετασχηματισμοί στην κατεύθυνση του y-axis.
order
MatrixOrder
Ένα Aspose.Imaging.MatrixOrder που καθορίζει αν πρέπει να προσθέσετε ή να προσαρμόσετε την κλίμακα.
TranslateTransform(Πλοία, Πλοία)
Μεταφράζει την τοπική γεωμετρική μεταμόρφωση με τις καθορισμένες διαστάσεις.Αυτή η μέθοδος δεσμεύει την μετάφραση στην μεταμόρφωση.
public void TranslateTransform(float dx, float dy)
Parameters
dx
float
Η αξία της μετάφρασης σε x.
dy
float
Η αξία της μετάφρασης σε y.
TranslateTransform(Πλοία, Πλοία, MatrixOrder)
Μεταφράζει την τοπική γεωμετρική μεταμόρφωση με τις καθορισμένες διαστάσεις στην καθορισμένη σειρά.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
Η αξία της μετάφρασης σε x.
dy
float
Η αξία της μετάφρασης σε y.
order
MatrixOrder
Η παραγγελία (prepend ή append) στην οποία θα εφαρμοστεί η μετάφραση.