WmfRecorderGraphics2D Class

Summary: The Wmf recorder.

Module: aspose.imaging.fileformats.wmf.graphics

Full Name: aspose.imaging.fileformats.wmf.graphics.WmfRecorderGraphics2D

Inheritance: MetafileRecorderGraphics2D

Aspose.Imaging Version: 24.5.0

Constructors

NameDescription
WmfRecorderGraphics2D(frame, inch)Initializes a new instance of the WmfRecorderGraphics2D class.

Properties

NameTypeAccessDescription
background_colorColorr/wGets or sets the color of the background.
background_modeWmfMixModer/wGets or sets the background mode.
clipRegionr/wGets or sets a Region that limits the drawing region of this Graphics
clip_boundsRectangleFrGets the clip bounds.

Methods

NameDescription
clear()Clears the state of the graphics object
draw_arc(pen, rect, start_angle, arc_angle)Draws an arc representing a portion of an ellipse specified by a Rectangle structure.
draw_cubic_bezier(pen, pt1, pt2, pt3, pt4)Draws the cubic bezier.
draw_ellipse(pen, rect)Draws the ellipse.
draw_image(image, dest_rect, src_rect, src_unit)Draws the specified portion of the specified Image at the specified location and with the specified size.
draw_image(image, location)Draws the specified Image, using its original physical size, at the specified location.
draw_image(image_bytes, dest_rect, src_unit)Draws the image.
draw_image(stream, dest_rect, src_unit)Draws the image.
draw_image_from_bytes(image_bytes, dest_rect, src_unit)Draws the image.
draw_image_from_stream(stream, dest_rect, src_unit)Draws the image.
draw_line(pen, pt1, pt2)Draws the line.
draw_line(pen, x1, y1, x2, y2)Draws the line.
draw_path(pen, path)Draws the path.
draw_pie(pen, rect, start_angle, sweep_angle)Draws the pie.
draw_poly_cubic_bezier(pen, points)Draws the poly cubic bezier.
draw_polygon(pen, points)Draws the polygon.
draw_polyline(pen, points)Draws the polyline.
draw_rectangle(pen, rectangle)Draws the rectangle.
draw_rectangle(pen, x, y, width, height)Draws the rectangle.
draw_string(string, font, color, x, y)Draws the string.
draw_string(string, font, color, x, y, angle)Draws the string.
end_recording()Ends the recording.
exclude_clip(rect)Updates the clip region of this Graphics to exclude the area specified by a Rectangle structure.
exclude_clip(region)Updates the clip region of this Graphics to exclude the area specified by a Region.
exclude_clip_rect(rect)Updates the clip region of this Graphics to exclude the area specified by a Rectangle structure.
exclude_clip_rgn(region)Updates the clip region of this Graphics to exclude the area specified by a Region.
fill_ellipse(brush, rect)Fills the ellipse.
fill_path(pen, brush, path)Fills the path.
fill_pie(brush, rect, start_angle, sweep_angle)Fills the pie.
fill_polygon(brush, points)Fills the polygon.
fill_polygon(brush, points, fill_mode)Fills the polygon.
fill_rectangle(brush, rectangle)Fills the rectangle.
from_wmf_image(wmf_image)Gets an instance of the Wmf recorder for the existing Wmf image.
get_transform()Gets the world transform.
intersect_clip(rect)Updates the clip region of this Graphics to the intersection of the current clip region and the specified Rectangle structure.
intersect_clip(region)Updates the clip region of this Graphics to the intersection of the current clip region and the specified Region.
intersect_clip_rect_f(rect)Updates the clip region of this Graphics to the intersection of the current clip region and the specified Rectangle structure.
intersect_clip_rgn(region)Updates the clip region of this Graphics to the intersection of the current clip region and the specified Region.
multiply_transform(matrix)Multiplies the world transformation of this Graphics and specified the Matrix.
multiply_transform(matrix, order)Multiplies the world transformation of this Graphics and specified the Matrix in the specified order.
reset_clip()Resets the clip.
rotate_transform(angle)Applies the specified rotation to the transformation matrix of this Graphics.
rotate_transform(angle, center, order)Applies the specified rotation to the transformation matrix of this Graphics in the specified order.
scale_transform(sx, sy)Applies the specified scaling operation to the transformation matrix of this Graphics by prepending it to the object’s transformation matrix.
scale_transform(sx, sy, order)Applies the specified scaling operation to the transformation matrix of this Graphics in the specified order.
set_transform(transform)Sets the transform.
translate_transform(x, y)Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.
translate_transform(x, y, order)Changes the origin of the coordinate system by applying the specified translation to the transformation matrix of this Graphics in the specified order.

Constructor: WmfRecorderGraphics2D(frame, inch)

 WmfRecorderGraphics2D(frame, inch) 

Initializes a new instance of the WmfRecorderGraphics2D class.

Parameters:

ParameterTypeDescription
frameRectangleDestination rectangle, measured in twips, for displaying the metafile.
inchintThe number of pixel per inch.

Method: draw_arc(pen, rect, start_angle, arc_angle)

 draw_arc(pen, rect, start_angle, arc_angle) 

Draws an arc representing a portion of an ellipse specified by a Rectangle structure.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
rectRectangleThe boundaries of the ellipse.
start_anglefloatAngle in degrees measured clockwise from the x-axis to the starting point of the arc.
arc_anglefloatAngle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Method: draw_cubic_bezier(pen, pt1, pt2, pt3, pt4)

 draw_cubic_bezier(pen, pt1, pt2, pt3, pt4) 

Draws the cubic bezier.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
pt1PointThe starting point of the curve.
pt2PointThe first control point for the curve.
pt3PointThe second control point for the curve.
pt4PointThe ending point of the curve.

Method: draw_ellipse(pen, rect)

 draw_ellipse(pen, rect) 

Draws the ellipse.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
rectRectangleThe boundaries of the ellipse.

Method: draw_image(image, dest_rect, src_rect, src_unit)

 draw_image(image, dest_rect, src_rect, src_unit) 

Draws the specified portion of the specified Image at the specified location and with the specified size.

Parameters:

ParameterTypeDescription
imageRasterImageThe image to draw.
dest_rectRectangleRectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
src_rectRectangleRectangle structure that specifies the portion of the image object to draw.
src_unitGraphicsUnitThe units of measure used by the srcRect parameter.

Method: draw_image(image, location)

 draw_image(image, location) 

Draws the specified Image, using its original physical size, at the specified location.

Parameters:

ParameterTypeDescription
imageRasterImageThe image to draw.
locationPointThe location of the upper-left corner of the drawn image.

Method: draw_image(image_bytes, dest_rect, src_unit)

 draw_image(image_bytes, dest_rect, src_unit) 

Draws the image.

Parameters:

ParameterTypeDescription
image_bytesbyteThe image bytes.
dest_rectRectangleThe dest rect.
src_unitGraphicsUnitThe source unit.

Method: draw_image(stream, dest_rect, src_unit)

 draw_image(stream, dest_rect, src_unit) 

Draws the image.

Parameters:

ParameterTypeDescription
stream_io.BufferedRandomThe stream.
dest_rectRectangleThe dest rect.
src_unitGraphicsUnitThe source unit.

Method: draw_image_from_bytes(image_bytes, dest_rect, src_unit)

 draw_image_from_bytes(image_bytes, dest_rect, src_unit) 

Draws the image.

Parameters:

ParameterTypeDescription
image_bytesbyteThe image bytes.
dest_rectRectangleThe dest rect.
src_unitGraphicsUnitThe source unit.

Method: draw_image_from_stream(stream, dest_rect, src_unit)

 draw_image_from_stream(stream, dest_rect, src_unit) 

Draws the image.

Parameters:

ParameterTypeDescription
stream_io.BufferedRandomThe stream.
dest_rectRectangleThe dest rect.
src_unitGraphicsUnitThe source unit.

Method: draw_line(pen, pt1, pt2)

 draw_line(pen, pt1, pt2) 

Draws the line.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
pt1PointThe first point.
pt2PointThe second point.

Method: draw_line(pen, x1, y1, x2, y2)

 draw_line(pen, x1, y1, x2, y2) 

Draws the line.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
x1intThe x-coordinate of the first point.
y1intThe y-coordinate of the first point.
x2intThe x-coordinate of the second point.
y2intThe y-coordinate of the second point.

Method: draw_path(pen, path)

 draw_path(pen, path) 

Draws the path.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
pathGraphicsPathThe path to draw.

Method: draw_pie(pen, rect, start_angle, sweep_angle)

 draw_pie(pen, rect, start_angle, sweep_angle) 

Draws the pie.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
rectRectangleThe boundaries of the ellipse.
start_anglefloatAngle in degrees measured clockwise from the x-axis to the starting point of the arc.
sweep_anglefloatAngle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Method: draw_poly_cubic_bezier(pen, points)

 draw_poly_cubic_bezier(pen, points) 

Draws the poly cubic bezier.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
pointsPoint[]The points.

Method: draw_polygon(pen, points)

 draw_polygon(pen, points) 

Draws the polygon.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
pointsPoint[]The points.

Method: draw_polyline(pen, points)

 draw_polyline(pen, points) 

Draws the polyline.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
pointsPoint[]The points.

Method: draw_rectangle(pen, rectangle)

 draw_rectangle(pen, rectangle) 

Draws the rectangle.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
rectangleRectangleThe rectangle to draw.

Method: draw_rectangle(pen, x, y, width, height)

 draw_rectangle(pen, x, y, width, height) 

Draws the rectangle.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
xintThe x-coordinate of the upper-left corner of the rectangle to draw.
yintThe y-coordinate of the upper-left corner of the rectangle to draw.
widthintThe width of the rectangle to draw.
heightintThe height of the rectangle to draw.

Method: draw_string(string, font, color, x, y)

 draw_string(string, font, color, x, y) 

Draws the string.

Parameters:

ParameterTypeDescription
stringstringThe string.
fontFontFont that defines the text format of the string.
colorColorThe text color.
xintThe x-coordinate of the upper-left corner of the drawn text.
yintThe y-coordinate of the upper-left corner of the drawn text.

Method: draw_string(string, font, color, x, y, angle)

 draw_string(string, font, color, x, y, angle) 

Draws the string.

Parameters:

ParameterTypeDescription
stringstringThe string.
fontFontFont that defines the text format of the string.
colorColorThe text color.
xintThe x-coordinate of the upper-left corner of the drawn text.
yintThe y-coordinate of the upper-left corner of the drawn text.
anglefloatThe angle in degrees, between the escapement vector and the x-axis of the device.
The escapement vector is parallel to the base line of a row of text.

Method: end_recording()

 end_recording() 

Ends the recording.

Returns

TypeDescription
WmfImageThe result image.

Method: exclude_clip(rect)

 exclude_clip(rect) 

Updates the clip region of this Graphics to exclude the area specified by a Rectangle structure.

Parameters:

ParameterTypeDescription
rectRectangleRectangle structure that specifies the rectangle to exclude from the clip region.

Method: exclude_clip(region)

 exclude_clip(region) 

Updates the clip region of this Graphics to exclude the area specified by a Region.

Parameters:

ParameterTypeDescription
regionRegionRegion that specifies the region to exclude from the clip region.

Method: exclude_clip_rect(rect)

 exclude_clip_rect(rect) 

Updates the clip region of this Graphics to exclude the area specified by a Rectangle structure.

Parameters:

ParameterTypeDescription
rectRectangleRectangle structure that specifies the rectangle to exclude from the clip region.

Method: exclude_clip_rgn(region)

 exclude_clip_rgn(region) 

Updates the clip region of this Graphics to exclude the area specified by a Region.

Parameters:

ParameterTypeDescription
regionRegionRegion that specifies the region to exclude from the clip region.

Method: fill_ellipse(brush, rect)

 fill_ellipse(brush, rect) 

Fills the ellipse.

Parameters:

ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
rectRectangleThe boundaries of the ellipse.

Method: fill_path(pen, brush, path)

 fill_path(pen, brush, path) 

Fills the path.

Parameters:

ParameterTypeDescription
penPenPen that determines the color, width, and style of the figure.
brushBrushBrush that determines the characteristics of the fill.
pathGraphicsPathThe path to fill.

Method: fill_pie(brush, rect, start_angle, sweep_angle)

 fill_pie(brush, rect, start_angle, sweep_angle) 

Fills the pie.

Parameters:

ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
rectRectangleThe boundaries of the ellipse.
start_anglefloatAngle in degrees measured clockwise from the x-axis to the starting point of the arc.
sweep_anglefloatAngle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Method: fill_polygon(brush, points)

 fill_polygon(brush, points) 

Fills the polygon.

Parameters:

ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
pointsPoint[]The points.

Method: fill_polygon(brush, points, fill_mode)

 fill_polygon(brush, points, fill_mode) 

Fills the polygon.

Parameters:

ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
pointsPoint[]The points.
fill_modeFillModeThe fill mode.

Method: fill_rectangle(brush, rectangle)

 fill_rectangle(brush, rectangle) 

Fills the rectangle.

Parameters:

ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
rectangleRectangleThe rectangle to fill.

Method: from_wmf_image(wmf_image) [static]

 from_wmf_image(wmf_image) 

Gets an instance of the Wmf recorder for the existing Wmf image.

Parameters:

ParameterTypeDescription
wmf_imageWmfImageThe Wmf image to get a recoreder for.

Returns

TypeDescription
WmfRecorderGraphics2DAn instance of the WmfRecorderGraphics2D class.

Method: get_transform()

 get_transform() 

Gets the world transform.

Returns

TypeDescription
MatrixThe transform matrix.

Method: intersect_clip(rect)

 intersect_clip(rect) 

Updates the clip region of this Graphics to the intersection of the current clip region and the specified Rectangle structure.

Parameters:

ParameterTypeDescription
rectRectangleFRectangle structure to intersect with the current clip region.

Method: intersect_clip(region)

 intersect_clip(region) 

Updates the clip region of this Graphics to the intersection of the current clip region and the specified Region.

Parameters:

ParameterTypeDescription
regionRegionRegion to intersect with the current region.

Method: intersect_clip_rect_f(rect)

 intersect_clip_rect_f(rect) 

Updates the clip region of this Graphics to the intersection of the current clip region and the specified Rectangle structure.

Parameters:

ParameterTypeDescription
rectRectangleFRectangle structure to intersect with the current clip region.

Method: intersect_clip_rgn(region)

 intersect_clip_rgn(region) 

Updates the clip region of this Graphics to the intersection of the current clip region and the specified Region.

Parameters:

ParameterTypeDescription
regionRegionRegion to intersect with the current region.

Method: multiply_transform(matrix)

 multiply_transform(matrix) 

Multiplies the world transformation of this Graphics and specified the Matrix.

Parameters:

ParameterTypeDescription
matrixMatrixThe matrix that multiplies the world transformation.

Method: multiply_transform(matrix, order)

 multiply_transform(matrix, order) 

Multiplies the world transformation of this Graphics and specified the Matrix in the specified order.

Parameters:

ParameterTypeDescription
matrixMatrixThe matrix that multiplies the world transformation.
orderMatrixOrderThe order of the multiplication.

Method: rotate_transform(angle)

 rotate_transform(angle) 

Applies the specified rotation to the transformation matrix of this Graphics.

Parameters:

ParameterTypeDescription
anglefloatAngle of rotation in degrees.

Method: rotate_transform(angle, center, order)

 rotate_transform(angle, center, order) 

Applies the specified rotation to the transformation matrix of this Graphics in the specified order.

Parameters:

ParameterTypeDescription
anglefloatAngle of rotation in degrees.
centerPointFThe rotating center.
orderMatrixOrderSpecifies whether the rotation is appended or prepended to the matrix transformation..

Method: scale_transform(sx, sy)

 scale_transform(sx, sy) 

Applies the specified scaling operation to the transformation matrix of this Graphics by prepending it to the object’s transformation matrix.

Parameters:

ParameterTypeDescription
sxfloatScale factor in the x direction.
syfloatScale factor in the y direction.

Method: scale_transform(sx, sy, order)

 scale_transform(sx, sy, order) 

Applies the specified scaling operation to the transformation matrix of this Graphics in the specified order.

Parameters:

ParameterTypeDescription
sxfloatScale factor in the x direction.
syfloatScale factor in the y direction.
orderMatrixOrderSpecifies whether the scaling operation is prepended or appended to the transformation matrix.

Method: set_transform(transform)

 set_transform(transform) 

Sets the transform.

Parameters:

ParameterTypeDescription
transformMatrixThe new transform matrix.

Method: translate_transform(x, y)

 translate_transform(x, y) 

Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the translation.
yfloatThe y-coordinate of the translation.

Method: translate_transform(x, y, order)

 translate_transform(x, y, order) 

Changes the origin of the coordinate system by applying the specified translation to the transformation matrix of this Graphics in the specified order.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the translation.
yfloatThe y-coordinate of the translation.
orderMatrixOrderSpecifies whether the translation is prepended or appended to the transformation matrix.