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
รับหรือตั้งพื้นที่คลิป
public Region Clip { get; set; }
คุณสมบัติมูลค่า
CompositingQuality
รับหรือตั้งค่าคุณภาพการประกอบ
public CompositingQuality CompositingQuality { get; set; }
คุณสมบัติมูลค่า
Dpix
รับความละเอียดแนวนอนของ Aspose.Imaging.Graphics นี้
public float DpiX { get; }
คุณสมบัติมูลค่า
DpiY
รับความละเอียดแนวตั้งของ Aspose.Imaging.Graphics นี้
public float DpiY { get; }
คุณสมบัติมูลค่า
Image
รับภาพ
public Image Image { get; }
คุณสมบัติมูลค่า
InterpolationMode
รับหรือตั้งโหมด interpolation
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
รับหรือตั้งค่าตัวเลือกภาพที่ใช้ในการสร้างภาพวาดวาดวาดวาดวาด
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()
เริ่มการ caching ของการดําเนินงานกราฟิกต่อไปนี้ ผลกราฟิกที่นําไปใช้หลังจากนั้นจะไม่นําไปใช้ทันทีแทน 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(เหล็ก, เหล็ก, เหล็ก, เหล็ก, เหล็ก, เหล็ก)
ดึงรูซึ่งเป็นส่วนหนึ่งของ ellipse ที่ระบุโดยคู่ของโค้ดความกว้างและความสูง
public void DrawArc(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
ความกว้างของแนวตั้งที่กําหนด ellipse
height
float
ความสูงของแนวตั้งที่กําหนด ellipse
startAngle
float
มุมในระดับวัดเวลาจากแกน X ไปยังจุดเริ่มต้นของแกน
sweepAngle
float
มุมในระดับวัดเวลาจากพารามิเตอร์ startAngle’ เพื่อจบจุดของรู
Exceptions
pen’ is null.
DrawArc(Pen, RectangleF, float, float)
สกรูรูซึ่งเป็นส่วนหนึ่งของ ellipse ที่ระบุโดยโครงสร้าง Aspose.Imaging.RectangleF
public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen ซึ่งกําหนดสีความกว้างและสไตล์ของกระดาษ
rect
RectangleF
Aspose.Imaging.RectangleF โครงสร้างที่กําหนดขอบเขตของ ellipse
startAngle
float
มุมในระดับวัดเวลาจากแกน X ไปยังจุดเริ่มต้นของแกน
sweepAngle
float
มุมในระดับวัดเวลาจากพารามิเตอร์ startAngle’ เพื่อจบจุดของรู
Exceptions
pen’ is null
DrawArc(Pen, int, int, int, int, int)
ดึงรูซึ่งเป็นส่วนหนึ่งของ ellipse ที่ระบุโดยคู่ของโค้ดความกว้างและความสูง
public void DrawArc(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
ความกว้างของแนวตั้งที่กําหนด ellipse
height
int
ความสูงของแนวตั้งที่กําหนด ellipse
startAngle
int
มุมในระดับวัดเวลาจากแกน X ไปยังจุดเริ่มต้นของแกน
sweepAngle
int
มุมในระดับวัดเวลาจากพารามิเตอร์ startAngle’ เพื่อจบจุดของรู
Exceptions
pen’ is null.
DrawArc(Pen, Rectangle, เฟอร์รี่, เฟอร์รี่)
สกรูรูซึ่งเป็นส่วนหนึ่งของ ellipse ที่ระบุโดยโครงสร้าง Aspose.Imaging.Rectangle
public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
Parameters
pen
Pen
Aspose.Imaging.Pen ซึ่งกําหนดสีความกว้างและสไตล์ของกระดาษ
rect
Rectangle
Aspose.Imaging.RectangleF โครงสร้างที่กําหนดขอบเขตของ ellipse
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.
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
หลักสูตร Y ของจุดเริ่มต้นของโค้ง
x2
float
หลักสูตร X ของจุดควบคุมครั้งแรกของโค้ง
y2
float
หลักสูตร y ของจุดควบคุมครั้งแรกของโค้ง
x3
float
หลักสูตร X ของจุดควบคุมที่สองของโค้ง
y3
float
หลักสูตร y ของจุดควบคุมที่สองของโค้ง
x4
float
หลักสูตร X ของจุดสิ้นสุดของโค้ง
y4
float
หลักสูตร Y ของจุดสิ้นสุดของโค้ง
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(หมายเลขรุ่น: Point[])
ดึงชุดของ Bézier splines จากชุดของโครงสร้าง 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 splines จากชุดของโครงสร้าง 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(หมายเลขรุ่น: Point[])
สกรูสกรูที่ปิดที่กําหนดโดยชุดของโครงสร้าง 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(หมายเลขรุ่น: Point[ ], เฟอร์รี่)
สกรูสกรูที่ปิดที่กําหนดโดยชุดของโครงสร้าง 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[ ], int , int)
การวาดแคลนแคลนผ่านชุดที่กําหนดของโครงสร้าง 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’ parameter ไปยังจุดเริ่มต้นในโค้ง
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’ parameter ไปยังจุดเริ่มต้นในโค้ง
numberOfSegments
int
จํานวนส่วนหลังจากจุดเริ่มต้นที่จะรวมอยู่ในโค้ง
tension
float
หมายเลขที่สูงกว่าหรือเท่ากับ 0.0F ซึ่งระบุความเครียดของโค้ง
Exceptions
pen’ is null.-or-
points’ is null.
DrawCurve(หมายเลขรุ่น: Point[])
สกรูสกรูสกรูสกรูสกรูสกรูสกรูสกรูสกรู 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(หมายเลขรุ่น: Point[ ], เฟอร์รี่)
การดึงสายเคเบิลผ่านชุดที่กําหนดของโครงสร้าง 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(หมายเลขรุ่น: Point[ ], 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’ parameter ไปยังจุดเริ่มต้นในโค้ง
numberOfSegments
int
จํานวนส่วนหลังจากจุดเริ่มต้นที่จะรวมอยู่ในโค้ง
tension
float
หมายเลขที่สูงกว่าหรือเท่ากับ 0.0F ซึ่งระบุความเครียดของโค้ง
Exceptions
pen’ is null.-or-
points’ is null.
DrawEllipse(ก้น, ก้น)
ดําเนินการ ellipse ที่กําหนดโดยการ จํากัด Aspose.Imaging.RectangleF
public void DrawEllipse(Pen pen, RectangleF rect)
Parameters
pen
Pen
Aspose.Imaging.Pen ซึ่งกําหนดสีความกว้างและสไตล์ของ ellipse
rect
RectangleF
Aspose.Imaging.RectangleF โครงสร้างที่กําหนดขอบเขตของ ellipse
Exceptions
pen’ is null.
DrawEllipse(เหล็ก, เหล็ก, เหล็ก, เหล็ก)
ดําเนินการแอลลิฟสที่กําหนดโดยแนวตั้งที่ระบุโดยคู่ของโค้ดความสูงและความกว้าง
public void DrawEllipse(Pen pen, float x, float y, float width, float height)
Parameters
pen
Pen
Aspose.Imaging.Pen ซึ่งกําหนดสีความกว้างและสไตล์ของ ellipse
x
float
รั้ว x ของมุมด้านบนและด้านซ้ายของมุมขอบที่กําหนด ellipse
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 ซึ่งกําหนดสีความกว้างและสไตล์ของ ellipse
rect
Rectangle
Aspose.Imaging.Rectangle โครงสร้างที่กําหนดขอบเขตของ ellipse
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(Pen, int, int, int, int)
ดําเนินการแอลลิฟสที่กําหนดโดยแนวตั้งที่ระบุโดยคู่ของโค้ดความสูงและความกว้าง
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
Parameters
pen
Pen
Aspose.Imaging.Pen ซึ่งกําหนดสีความกว้างและสไตล์ของ ellipse
x
int
รั้ว x ของมุมด้านบนและด้านซ้ายของมุมขอบที่กําหนด ellipse
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(ภาพ, float, float)
แสดง 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, 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(รูปภาพ, จุด[])
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, Point[] destPoints)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
Point
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
DrawImage(รูปภาพ, จุด[ ], ตรง)
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
Point
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
srcRect
Rectangle
ตรงของแหล่งที่มา
DrawImage(รูปภาพ, จุด[ ], Rectangle, GraphicsUnit)
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
Point
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
srcRect
Rectangle
ตรงของแหล่งที่มา
srcUnit
GraphicsUnit
หน่วยวัด
DrawImage(รูปภาพ, จุด[ ], Rectangle, GraphicsUnit, ImageAttributes)
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
Point
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
srcRect
Rectangle
ตรงของแหล่งที่มา
srcUnit
GraphicsUnit
หน่วยวัด
imageAttributes
ImageAttributes
ภาพมีคุณสมบัติ
DrawImage(รูปภาพ, PointF[])
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, PointF[] destPoints)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
PointF
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
Exceptions
รูปภาพ
DrawImage(รูปภาพ, PointF[ ], ก้น)
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
PointF
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
srcRect
RectangleF
ตรงของแหล่งที่มา
DrawImage(รูปภาพ, PointF[ ], RectangleF, GraphicsUnit)
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
PointF
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
srcRect
RectangleF
ตรงของแหล่งที่มา
srcUnit
GraphicsUnit
หน่วยวัด
DrawImage(รูปภาพ, PointF[ ], RectangleF, GraphicsUnit, ImageAttributes)
ดึงส่วนที่ระบุของภาพ " ที่ตําแหน่งที่ระบุและขนาดที่ระบุ
public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)
Parameters
image
Image
รูปภาพที่จะดึง
destPoints
PointF
[ ]
ชุดของสามโครงสร้าง PointF ที่กําหนดค่า parallelogram
srcRect
RectangleF
ตรงของแหล่งที่มา
srcUnit
GraphicsUnit
หน่วยวัด
imageAttributes
ImageAttributes
ภาพมีคุณสมบัติ
DrawImage(ภาพ, float, float, float, float)
แสดง 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(ภาพ, ตรง)
แสดง 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(ภาพ, ตรง)
การวาดภาพที่กําหนดโดยใช้ขนาดทางกายภาพเดิมในสถานที่ที่กําหนด
public void DrawImageUnscaled(Image sourceImage, Rectangle rect)
Parameters
sourceImage
Image
รูปภาพที่จะดึงด้วย
rect
Rectangle
Aspose.Imaging.Rectangle ซึ่งระบุมุมด้านบนด้านซ้ายของภาพดึง คุณสมบัติ X และ Y ของมุมซ้ายระบุมุมด้านบนด้านซ้าย คุณสมบัติ ความกว้างและความสูงจะถูก ignored
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(ภาพ, ตรง)
สกรูภาพที่ระบุโดยไม่ต้องสกรูและคลิกมันถ้าจําเป็นเพื่อให้เหมาะกับมุมตรงที่ระบุ
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(Pen, 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
หลักสูตร Y ของจุดแรก
x2
int
หลักสูตร X ของจุดที่สอง
y2
int
องค์ประกอบ Y ของจุดที่สอง
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
หลักสูตร Y ของจุดแรก
x2
float
หลักสูตร X ของจุดที่สอง
y2
float
องค์ประกอบ Y ของจุดที่สอง
Exceptions
pen’ is null.
DrawLines(หมายเลขรุ่น: Point[])
ดําเนินการชุดของส่วนเส้นที่เชื่อมต่อชุดของโครงสร้าง 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.
ช่วง point" มีจุดน้อยกว่า 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.
ช่วง point" มีจุดน้อยกว่า 2 จุด
DrawPath(โป๊, GraphicsPath)
ลําดับ Aspose.Imaging.GraphicsPath
public void DrawPath(Pen pen, GraphicsPath path)
Parameters
pen
Pen
Aspose.Imaging.Pen ซึ่งกําหนดสีความกว้างและสไตล์ของเส้นทาง
path
GraphicsPath
Aspose.Imaging.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(Pen, RectangleF, float, float)
สกรูรูปร่างที่กําหนดโดย ellipse ที่ระบุโดยโครงสร้าง 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-axis ไปยังด้านแรกของรูปร่าง pie
sweepAngle
float
มุมวัดในระดับเวลาจากพารามิเตอร์ startAngle’ ไปยังด้านที่สองของรูปร่างขา
Exceptions
pen’ is null.
DrawPie(เหล็ก, เหล็ก, เหล็ก, เหล็ก, เหล็ก, เหล็ก)
ดึงรูปร่างขาที่กําหนดโดย ellipse ที่ระบุโดยคู่คํานวณความกว้างความสูงและเส้นด้ายสองเส้น
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-axis ไปยังด้านแรกของรูปร่าง pie
sweepAngle
float
มุมวัดในระดับเวลาจากพารามิเตอร์ startAngle’ ไปยังด้านที่สองของรูปร่างขา
Exceptions
pen’ is null.
DrawPie(Pen, Rectangle, เฟอร์รี่, เฟอร์รี่)
สกรูรูปร่างที่กําหนดโดย ellipse ที่ระบุโดยโครงสร้าง 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 โครงสร้างที่แสดงให้เห็นถึงขอบขอบที่กําหนด ellipse จากที่รูปร่างขามา
startAngle
float
มุมวัดในระดับชั่วโมงจาก x-axis ไปยังด้านแรกของรูปร่าง pie
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(Pen, int, int, int, int, int)
ดึงรูปร่างขาที่กําหนดโดย ellipse ที่ระบุโดยคู่คํานวณความกว้างความสูงและเส้นด้ายสองเส้น
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-axis ไปยังด้านแรกของรูปร่าง pie
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(หมายเลขรุ่น: Point[])
สกรูโพลีโคนที่กําหนดโดยชุดของโครงสร้าง 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(ก้น, ก้น)
ดึงเส้นตรงที่ระบุโดยโครงสร้าง Aspose.Imaging.RectangleF
public void DrawRectangle(Pen pen, RectangleF rect)
Parameters
pen
Pen
A 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
A 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
A Aspose.Imaging.Pen ซึ่งกําหนดสีกว้างและสไตล์ของแนวตั้ง
x
float
รั้ว x ของมุมด้านบนด้านซ้ายของมุมตรงเพื่อดึง
y
float
หลักสูตร y ของมุมด้านบนด้านซ้ายของมุมตรงเพื่อดึง
width
float
ความกว้างของแนวตั้งที่จะดึง
height
float
ความสูงของแนวตั้งที่จะดึง
Exceptions
pen’ is null.
DrawRectangle(Pen, 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(ก้น, ก้น[])
ดําเนินการชุดของแนวตั้งที่ระบุโดยโครงสร้าง 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
ตัวอย่างนี้แสดงให้เห็นถึงการสร้างและใช้วัตถุ Pen ตัวอย่างนี้สร้างภาพใหม่และดึงมุมตรงบนพื้นผิวของภาพ
//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(สกรู, สกรู, สกรู, สกรู)
ลวดข้อความที่ระบุไว้ในสถานที่ที่ระบุไว้ด้วย 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(รั้ว, รั้ว, 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(สกรู, Font, Brush, float, float, StringFormat)
ลวดข้อความที่ระบุในสถานที่ที่ระบุด้วย 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(รั้ว, รั้ว, 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()
เสร็จสิ้นการ caching ของการดําเนินงานกราฟิกที่เริ่มต้นหลังจากที่ 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 ใช้โหมดเติมที่ระบุ วิธีการนี้ใช้แรงดันไฟฟ้าเริ่มต้น 0.5
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, float)
ปลั๊กอินของโค้งโค้งโค้งโค้งปิดที่กําหนดโดยชุดของโครงสร้าง Aspose.Imaging.PointF ใช้โหมดเติมและแรงดันที่ระบุ
public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)
Parameters
brush
Brush
A 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(บูช, จุด[])
ปลั๊กอินของโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้ง
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(บูช, จุด[ ], FillMode)
ปลั๊กอินของโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้ง
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(บูช, จุด[ ], FillMode, float)
ปลั๊กอินของโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้งโค้ง
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)
เสร็จสมบูรณ์ภายในของ ellipse ที่กําหนดโดยแนวตั้งที่ระบุโดยโครงสร้าง Aspose.Imaging.RectangleF
public void FillEllipse(Brush brush, RectangleF rect)
Parameters
brush
Brush
Aspose.Imaging.Brush ซึ่งกําหนดลักษณะของบรรจุ
rect
RectangleF
Aspose.Imaging.RectangleF โครงสร้างที่แสดงให้เห็นถึงขอบขอบที่กําหนด ellipse
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 ของมุมด้านบนและด้านซ้ายของมุมขอบที่กําหนด ellipse
y
float
หลักสูตร y ของมุมด้านบนและด้านซ้ายของมุมขอบที่กําหนดความล้มเหลว
width
float
ความกว้างของขอบขอบที่กําหนดความล้มเหลว
height
float
ความสูงของทิศทางขอบซึ่งกําหนดความล้มเหลว
Exceptions
brush’ is null.
FillEllipse(ตูด, ตูด)
เสร็จสมบูรณ์ภายในของ ellipse ที่กําหนดโดยแนวตั้งที่ระบุโดยโครงสร้าง Aspose.Imaging.Rectangle
public void FillEllipse(Brush brush, Rectangle rect)
Parameters
brush
Brush
Aspose.Imaging.Brush ซึ่งกําหนดลักษณะของบรรจุ
rect
Rectangle
Aspose.Imaging.Rectangle โครงสร้างซึ่งแสดงให้เห็นถึงขอบขอบที่กําหนด ellipse
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 ของมุมด้านบนและด้านซ้ายของมุมขอบที่กําหนด ellipse
y
int
หลักสูตร y ของมุมด้านบนและด้านซ้ายของมุมขอบที่กําหนดความล้มเหลว
width
int
ความกว้างของขอบขอบที่กําหนดความล้มเหลว
height
int
ความสูงของทิศทางขอบซึ่งกําหนดความล้มเหลว
Exceptions
brush’ is null.
FillPath(สกรู, GraphicsPath)
เสร็จสิ้นภายในของ 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(สกรู, ตรง, float, float)
เสร็จสมบูรณ์ภายในของส่วนที่กําหนดโดย ellipse ที่ระบุโดยโครงสร้าง 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 โครงสร้างที่แสดงให้เห็นถึงขอบขอบที่กําหนด ellipse จากที่ส่วนขามา
startAngle
float
มุมในระดับวัดเวลาจากแกน x ไปยังด้านแรกของส่วน pie
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)
เสร็จสมบูรณ์ภายในของส่วนที่กําหนดโดย ellipse ที่ระบุโดยโครงสร้าง 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 ไปยังด้านแรกของส่วน pie
sweepAngle
float
มุมในระดับวัดเวลาจากพารามิเตอร์ startAngle’ ไปยังด้านที่สองของส่วน pie
Exceptions
brush’ is null.
FillPie(สกรู, สกรู, สกรู, สกรู, สกรู, สกรู)
รอบด้านในของส่วนที่กําหนดโดย ellipse ที่ระบุโดยคู่ของโค้ด ความกว้าง ความสูง และสองเส้นด้าย
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 ไปยังด้านแรกของส่วน pie
sweepAngle
float
มุมในระดับวัดเวลาจากพารามิเตอร์ startAngle’ ไปยังด้านที่สองของส่วน pie
Exceptions
brush’ is null.
FillPie(สกรู, int, int, int, int, int, int)
รอบด้านในของส่วนที่กําหนดโดย ellipse ที่ระบุโดยคู่ของโค้ด ความกว้าง ความสูง และสองเส้นด้าย
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 ไปยังด้านแรกของส่วน pie
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)
เสร็จสมบูรณ์ภายในของ polygon ที่กําหนดโดยช่วงของจุดที่ระบุโดย 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(บูช, จุด[])
เสร็จสมบูรณ์ภายในของโพลีโคนที่กําหนดโดยช่วงของจุดที่ระบุโดย 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(บูช, จุด[ ], FillMode)
เสร็จสมบูรณ์ภายในของ polygon ที่กําหนดโดยช่วงของจุดที่ระบุโดย 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(ตูด, ตูด)
เต็มภายในของแนวตั้งที่ระบุโดยโครงสร้าง 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(ตูด, ตูด[])
เสร็จสมบูรณ์ภายในของชุดของแนวตั้งที่ระบุโดย 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.Region ซึ่งหมายถึงพื้นที่ที่จะเติม
Exceptions
brush’ is null.-or-
region’ is null.
~Graphics()
protected ~Graphics()
MeasureString(string, หมายเลข, SizeF, StringFormat)
การวัดเส้นข้อความที่ระบุด้วยพารามิเตอร์ที่ระบุ
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
Parameters
text
string
ข้อความที่จะวัด
font
Font
หมายเลขเพื่อวัด
layoutArea
SizeF
พื้นที่ layout
stringFormat
StringFormat
รูปแบบ string
Returns
ขนาดในพิกเซลของแถวข้อความที่วัด
MultiplyTransform(Matrix)
multiplies the Aspose.Imaging.Matrix which represents the local geometric transform of this Aspose.Imaging.Graphics by the specified Aspose.Imaging.Matrix by prepending the specified Aspose.Imaging.Matrix
public void MultiplyTransform(Matrix matrix)
Parameters
matrix
Matrix
The Aspose.Imaging.Matrix โดยที่ที่จะเพิ่มขึ้นการเปลี่ยนแปลงทางภูมิศาสตร์
MultiplyTransform(Matrix และ MatrixOrder)
multiplies the Aspose.Imaging.Matrix which represents the local geometric transform of this Aspose.Imaging.Graphics by the specified Aspose.Imaging.Matrix in the specified order
public void MultiplyTransform(Matrix matrix, MatrixOrder order)
Parameters
matrix
Matrix
The Aspose.Imaging.Matrix โดยที่ที่จะเพิ่มขึ้นการเปลี่ยนแปลงทางภูมิศาสตร์
order
MatrixOrder
A Aspose.Imaging.MatrixOrder ซึ่งระบุในวัตถุประสงค์ที่จะ multiply ทั้งสอง 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
A 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
A 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) ที่จะใช้การแปล