GraphicsContext is a drawing context that can be used to do high-quality
anti-aliased drawing, and sophisticated transforms upon text, lines and
images such as shears and rotations.
The GraphicsContext instance is the object that carries out the drawing
upon a Window or other graphics surface, such as a Bitmap or Printer. In
wxRuby, one is created by calling
GraphicsContext.create and passing either an
ordinary DeviceContext instance, or a Window
that should be drawn upon.
Creates a GraphicsContext from a WindowDC (eg a PaintDC).
GraphicsContext create(%(arg-type)Window% window)Creates a GraphicsContext from a Window.
Creates a native pen from a Pen.
Creates a native brush from a Brush.
Creates a native brush, having a radial gradient originating at (xo,yc) with color oColour and ends on a circle around (xc,yc) with radius r and color cColour
Creates a native brush, having a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
Creates a native graphics font from a Font and a text colour.
Creates a native affine transformation matrix from the passed in values. The defaults result in an identity matrix.
Creates a native graphics path which is initially empty.
Clips drawings to the region, combined to current clipping region
clip(%(arg-type)Double% x, Double y, Double w, Double h)Clips drawings to the rectangle.
Resets the clipping to original shape.
Draws the bitmap. In case of a mono bitmap, this is treated as a mask and the current brushed is used for filling.
Draws an ellipse.
Draws the icon.
Draws a polygon.
Draws the path by first filling and then stroking.
Draws a rectangle.
Draws a rounded rectangle.
Draws a text at the defined position, at the given angle.
Fills the path with the current brush.
Strokes along a path with the current pen.
Returns the native context (CGContextRef for Core Graphics, Graphics pointer for GDIPlus and cairo_t pointer for cairo).
Fills the widths array with the widths from the beginning of
text to the corresponding character of text.
Gets the dimensions of the string using the currently selected font.
rotate(%(arg-type)Double% angle)
Rotates the current transformation matrix (radians)
scale(%(arg-type)Double% x_scale, Double y_scale)
Scales the current transformation matrix.
translate(%(arg-type)Double% dx, Double dy)
Translates the current transformation matrix.
GraphicsMatrix get_transform()
Gets the current transformation matrix of this context.
set_transform(%(arg-type)GraphicsMatrix% matrix)
Sets the current transformation matrix of this context.
concat_transform(%(arg-type)GraphicsMatrix% matrix)
Concatenates the passed in transform with the current transform of this context.
set_brush(%(arg-type)Brush% brush)
set_brush(%(arg-type)GraphicsBrush% brush)
Sets the brush for filling paths.
set_font(%(arg-type)Font% font, Colour colour)
set_font(%(arg-type)GraphicsFont% font)
Sets the font for drawing text.
set_pen(%(arg-type)Pen% pen)
set_pen(%(arg-type)GraphicsPen% pen)
Sets the pen used for stroking.
strokeline(%(arg-type)Double% x1,%(arg-type)Double% y1,%(arg-type)Double% x2,%(arg-type)Double% y2)
Strokes a single line.
strokelines(%(arg-type)Integer% n,%(arg-type)Point2DDouble% begin_points,%(arg-type)Point2DDouble% end_points)
strokelines(%(arg-type)Integer% n,%(arg-type)Point2DDouble% points)
Stroke disconnected lines from begin to end points, fastest method available for this purpose.
[This page automatically generated from the Textile source at 2023-06-03 08:07:38 +0000]