wxRuby Documentation Home

Wx::GraphicsPath

A GraphicsPath is a native representation of an geometric path. The contents are specific an private to the respective renderer. Instances are ref counted and can
therefore be assigned as usual. The only way to get a valid instance is via a CreatePath call on the graphics context or the renderer instance.

Derived from

GraphicsObject

Methods

GraphicsPath#move_to_point

move_to_point(%(arg-type)Double% x, Double y) move_to_point(%(arg-type)Point2DDouble% p)

Begins a new subpath at (x,y)

GraphicsPath#add_arc

add_arc(%(arg-type)Double% x, Double y, Double r, Double startAngle, Double endAngle, Boolean clockwise)

Adds an arc of a circle centering at (x,y) with radius® from startAngle to endAngle.

add_arc(%(arg-type)Point2DDouble% c, Double r, Double startAngle, Double endAngle, Boolean clockwise)

GraphicsPath#add_arc_to_point

add_arc_to_point(%(arg-type)Double% x1, Double y1, Double x2, Double y2, Double r)

Appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1).

GraphicsPath#add_circle

add_circle(%(arg-type)Double% x, Double y, Double r)

Appends a circle around (x,y) with radius r as a new closed subpath.

GraphicsPath#add_curve_to_point

add_curve_to_point(%(arg-type)Double% cx1, Double cy1, Double cx2, Double cy2, Double x, Double y)

Adds a cubic Bezier curve from the current point, using two control points and an end point.

add_curve_to_point(%(arg-type)Point2DDouble% c1, Point2DDouble c2, Point2DDouble e)

GraphicsPath#add_ellipse

add_ellipse(%(arg-type)Double% x, Double y, Double w, Double h)

Appends an ellipse fitting into the passed in rectangle.

GraphicsPath#add_line_to_point

add_line_to_point(%(arg-type)Double% x, Double y)

Adds a straight line from the current point to (x,y).

add_line_to_point(%(arg-type)Point2DDouble% p)

GraphicsPath#add_path

add_path(%(arg-type)GraphicsPath% path)

Adds another path.

GraphicsPath#add_quad_curve_to_point

add_quad_curve_to_point(%(arg-type)Double% cx, Double cy, Double x, Double y)

Adds a quadratic Bezier curve from the current point, using a control point and an end point.

GraphicsPath#add_rectangle

add_rectangle(%(arg-type)Double% x, Double y, Double w, Double h)

Appends a rectangle as a new closed subpath.

GraphicsPath#add_rounded_rectangle

add_rounded_rectangle(%(arg-type)Double% x, Double y, Double w, Double h, Double radius)

Appends a rounded rectangle as a new closed subpath.

GraphicsPath#close_subpath

close_subpath()

Closes the current sub-path.

GraphicsPath#contains

Boolean contains(%(arg-type)Point2DDouble% c, Integer fillStyle = ODDEVEN_RULE) Boolean contains(%(arg-type)Double% x, Double y, Integer fillStyle = ODDEVEN_RULE)

Returns true if the point is within the path.

GraphicsPath#get_box

Rect2DDouble get_box() get_box(%(arg-type)Double% x, Double y, Double w, Double h)

Gets the bounding box enclosing all points (possibly including control points).

GraphicsPath#get_current_point

get_current_point(%(arg-type)Double% x, Double y) Point2DDouble get_current_point()

Gets the last point of the current path, (0,0) if not yet set.

GraphicsPath#transform

transform(%(arg-type)GraphicsMatrix% matrix)

Transforms each point of this path by the matrix.

GraphicsPath#get_native_path

get_native_path()

Returns the native path (CGPathRef for Core Graphics, Path pointer for GDIPlus and a cairo_path_t pointer for cairo).

GraphicsPath#un_get_native_path

un_get_native_path(%(arg-type)% p)

Gives back the native path returned by GetNativePath() because there might be some deallocations necessary (eg on cairo the native path returned by
GetNativePath is newly allocated each time).

[This page automatically generated from the Textile source at 2023-06-09 00:45:31 +0000]