WmfRecorderGraphics2D Class
Summary: The Wmf recorder.
Module: aspose.imaging.fileformats.wmf.graphics
Full Name: aspose.imaging.fileformats.wmf.graphics.WmfRecorderGraphics2D
Inheritance: MetafileRecorderGraphics2D
Constructors
| Name | Description |
|---|---|
| WmfRecorderGraphics2D(frame, inch) | Initializes a new instance of the WmfRecorderGraphics2D class. |
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| background_color | Color | r/w | Gets or sets the color of the background. |
| background_mode | WmfMixMode | r/w | Gets or sets the background mode. |
| clip | Region | r/w | Gets or sets a Region that limits the drawing region of this Graphics |
| clip_bounds | RectangleF | r | Gets the clip bounds. |
Methods
| Name | Description |
|---|---|
| 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:
| Parameter | Type | Description |
|---|---|---|
| frame | Rectangle | Destination rectangle, measured in twips, for displaying the metafile. |
| inch | int | The 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:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| rect | Rectangle | The boundaries of the ellipse. |
| start_angle | float | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| arc_angle | float | Angle 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:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| pt1 | Point | The starting point of the curve. |
| pt2 | Point | The first control point for the curve. |
| pt3 | Point | The second control point for the curve. |
| pt4 | Point | The ending point of the curve. |
Method: draw_ellipse(pen, rect)
draw_ellipse(pen, rect)
Draws the ellipse.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| rect | Rectangle | The 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:
| Parameter | Type | Description |
|---|---|---|
| image | RasterImage | The image to draw. |
| dest_rect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| src_rect | Rectangle | Rectangle structure that specifies the portion of the image object to draw. |
| src_unit | GraphicsUnit | The 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:
| Parameter | Type | Description |
|---|---|---|
| image | RasterImage | The image to draw. |
| location | Point | The 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:
| Parameter | Type | Description |
|---|---|---|
| image_bytes | System.Byte | The image bytes. |
| dest_rect | Rectangle | The dest rect. |
| src_unit | GraphicsUnit | The source unit. |
Method: draw_image(stream, dest_rect, src_unit)
draw_image(stream, dest_rect, src_unit)
Draws the image.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | _io.BufferedRandom | The stream. |
| dest_rect | Rectangle | The dest rect. |
| src_unit | GraphicsUnit | The 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:
| Parameter | Type | Description |
|---|---|---|
| image_bytes | System.Byte | The image bytes. |
| dest_rect | Rectangle | The dest rect. |
| src_unit | GraphicsUnit | The 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:
| Parameter | Type | Description |
|---|---|---|
| stream | _io.BufferedRandom | The stream. |
| dest_rect | Rectangle | The dest rect. |
| src_unit | GraphicsUnit | The source unit. |
Method: draw_line(pen, pt1, pt2)
draw_line(pen, pt1, pt2)
Draws the line.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| pt1 | Point | The first point. |
| pt2 | Point | The second point. |
Method: draw_line(pen, x1, y1, x2, y2)
draw_line(pen, x1, y1, x2, y2)
Draws the line.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| x1 | int | The x-coordinate of the first point. |
| y1 | int | The y-coordinate of the first point. |
| x2 | int | The x-coordinate of the second point. |
| y2 | int | The y-coordinate of the second point. |
Method: draw_path(pen, path)
draw_path(pen, path)
Draws the path.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| path | GraphicsPath | The path to draw. |
Method: draw_pie(pen, rect, start_angle, sweep_angle)
draw_pie(pen, rect, start_angle, sweep_angle)
Draws the pie.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| rect | Rectangle | The boundaries of the ellipse. |
| start_angle | float | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| sweep_angle | float | Angle 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:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| points | Point[] | The points. |
Method: draw_polygon(pen, points)
draw_polygon(pen, points)
Draws the polygon.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| points | Point[] | The points. |
Method: draw_polyline(pen, points)
draw_polyline(pen, points)
Draws the polyline.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| points | Point[] | The points. |
Method: draw_rectangle(pen, rectangle)
draw_rectangle(pen, rectangle)
Draws the rectangle.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| rectangle | Rectangle | The rectangle to draw. |
Method: draw_rectangle(pen, x, y, width, height)
draw_rectangle(pen, x, y, width, height)
Draws the rectangle.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| x | int | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | int | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | int | The width of the rectangle to draw. |
| height | int | The 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:
| Parameter | Type | Description |
|---|---|---|
| string | string | The string. |
| font | Font | Font that defines the text format of the string. |
| color | Color | The text color. |
| x | int | The x-coordinate of the upper-left corner of the drawn text. |
| y | int | The 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:
| Parameter | Type | Description |
|---|---|---|
| string | string | The string. |
| font | Font | Font that defines the text format of the string. |
| color | Color | The text color. |
| x | int | The x-coordinate of the upper-left corner of the drawn text. |
| y | int | The y-coordinate of the upper-left corner of the drawn text. |
| angle | float | The 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
| Type | Description |
|---|---|
| WmfImage | The 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:
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle 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:
| Parameter | Type | Description |
|---|---|---|
| region | Region | Region 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:
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle 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:
| Parameter | Type | Description |
|---|---|---|
| region | Region | Region that specifies the region to exclude from the clip region. |
Method: fill_ellipse(brush, rect)
fill_ellipse(brush, rect)
Fills the ellipse.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | Rectangle | The boundaries of the ellipse. |
Method: fill_path(pen, brush, path)
fill_path(pen, brush, path)
Fills the path.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the figure. |
| brush | Brush | Brush that determines the characteristics of the fill. |
| path | GraphicsPath | The path to fill. |
Method: fill_pie(brush, rect, start_angle, sweep_angle)
fill_pie(brush, rect, start_angle, sweep_angle)
Fills the pie.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | Rectangle | The boundaries of the ellipse. |
| start_angle | float | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| sweep_angle | float | Angle 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:
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | The points. |
Method: fill_polygon(brush, points, fill_mode)
fill_polygon(brush, points, fill_mode)
Fills the polygon.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | The points. |
| fill_mode | FillMode | The fill mode. |
Method: fill_rectangle(brush, rectangle)
fill_rectangle(brush, rectangle)
Fills the rectangle.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rectangle | Rectangle | The 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:
| Parameter | Type | Description |
|---|---|---|
| wmf_image | WmfImage | The Wmf image to get a recoreder for. |
Returns
| Type | Description |
|---|---|
| WmfRecorderGraphics2D | An instance of the WmfRecorderGraphics2D class. |
Method: get_transform()
get_transform()
Gets the world transform.
Returns
| Type | Description |
|---|---|
| Matrix | The 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:
| Parameter | Type | Description |
|---|---|---|
| rect | RectangleF | Rectangle 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:
| Parameter | Type | Description |
|---|---|---|
| region | Region | Region 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:
| Parameter | Type | Description |
|---|---|---|
| rect | RectangleF | Rectangle 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:
| Parameter | Type | Description |
|---|---|---|
| region | Region | Region 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:
| Parameter | Type | Description |
|---|---|---|
| matrix | Matrix | The 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:
| Parameter | Type | Description |
|---|---|---|
| matrix | Matrix | The matrix that multiplies the world transformation. |
| order | MatrixOrder | The order of the multiplication. |
Method: rotate_transform(angle)
rotate_transform(angle)
Applies the specified rotation to the transformation matrix of this Graphics.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| angle | float | Angle 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:
| Parameter | Type | Description |
|---|---|---|
| angle | float | Angle of rotation in degrees. |
| center | PointF | The rotating center. |
| order | MatrixOrder | Specifies 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:
| Parameter | Type | Description |
|---|---|---|
| sx | float | Scale factor in the x direction. |
| sy | float | Scale 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:
| Parameter | Type | Description |
|---|---|---|
| sx | float | Scale factor in the x direction. |
| sy | float | Scale factor in the y direction. |
| order | MatrixOrder | Specifies whether the scaling operation is prepended or appended to the transformation matrix. |
Method: set_transform(transform)
set_transform(transform)
Sets the transform.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| transform | Matrix | The 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:
| Parameter | Type | Description |
|---|---|---|
| x | float | The x-coordinate of the translation. |
| y | float | The 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:
| Parameter | Type | Description |
|---|---|---|
| x | float | The x-coordinate of the translation. |
| y | float | The y-coordinate of the translation. |
| order | MatrixOrder | Specifies whether the translation is prepended or appended to the transformation matrix. |