Class EmfPlusDrawEllipse
Namespace: Aspose.Imaging.FileFormats.Emf.EmfPlus.Records
Assembly: Aspose.Imaging.dll (25.7.0)
The EmfPlusDrawEllipse record specifies drawing an ellipse.
public sealed class EmfPlusDrawEllipse : EmfPlusDrawingRecordType
{
public short x;
public short y;
public short width;
public short height;
public EllipseAttributes ellipseAttributes;
}
Inheritance
object ← MetaObject ← EmfPlusRecord ← EmfPlusDrawingRecordType ← EmfPlusDrawEllipse
Inherited Members
EmfPlusRecord.Type , EmfPlusRecord.Flags , EmfPlusRecord.Size , EmfPlusRecord.DataSize , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
EmfPlusDrawEllipse(EmfPlusRecord)
Initializes a new instance of the Aspose.Imaging.FileFormats.Emf.EmfPlus.Records.EmfPlusDrawEllipse class.
public void EmfPlusDrawEllipse(EmfPlusRecord source)
{
var x = source.GetShortInt();
var y = source.GetShortInt();
var width = source.GetLongInt();
var height = source.GetLongInt();
using (var pathGeometry = new PathGeometry())
{
var startPoint = new Point(x, y);
var ellipticalFigure = new Ellipse figure{StartPoint = startPoint};
double radiusX = width / 2.0;
double radiusY = height / 2.0;
ellipticalFigure.RadiusX = radiusX;
ellipticalFigure.RadiusY = radiusY;
pathGeometry.Figures.Add(ellipticalFigure);
var pen = new Pen();
pen.Brush = Brushes.Black;
pen.Width = 1;
var geometry = new DrawingBrush(pen.Brush);
geometry.AlignmentX = AlignmentX.Center;
geometry.AlignmentY = AlignmentY.Center;
var drawEllipse = new DrawingBrushElement3D();
drawEllipse.Geometry = pathGeometry;
drawEllipse.Transform = new Transform3DGroup();
drawEllipse.Transform = Transform3D.Translation(new Point3D(-x, -y, 0));
drawEllipse.Brush = geometry;
var drawContext = context as DrawingContext;
if (drawContext != null)
drawContext.DrawGeometry(brush, pen, pathGeometry);
}
}
Parameters
source
EmfPlusRecord
The source.
Properties
Compressed
Gets or sets a value indicating whether the PointData is compressed.If set, RectData contains an EmfPlusRect object (section 2.2.2.38).If clear, RectData contains an EmfPlusRectF object (section 2.2.2.39).
public bool Compressed
{
get;
set;
}
Property Value
ObjectId
Gets or sets the object identifier.The index of an EmfPlusPen (section 2.2.1.7) object in the EMF+Object Table to draw the ellipse. The value MUST be zero to 63, inclusive.
public byte ObjectId
{
get;
set;
}
Property Value
RectData
Gets or sets the rectangle dataEither an EmfPlusRect or EmfPlusRectF object that defines the bounding box of the ellipse.
public RectangleF RectData
{
get;
set;
}