Instance methods
blit(image : Image, point : PointI, area : RectI | Nil = nil)
Blit an image onto the canvas.
Sourceblit(image : Image, point : Point, area : RectI | Nil = nil)
Blit an image onto the canvas.
Sourceblit(image : Image, rect : RectI, area : RectI | Nil = nil)
Blit an image onto the canvas.
Sourceblit(image : Image, rect : Rect, area : RectI | Nil = nil)
Blit an image onto the canvas.
Sourceclear_rect(rect : RectI)
Clear an area of the context defined by a RectI.
Sourceclear_rect(rect : Rect)
Clear an area of the context defined by a Rect.
Sourceclip_to_rect(rect : RectI)
Clip the context to a RectI.
Sourceclip_to_rect(rect : Rect)
Clip the context to a Rect.
Sourcecomposition_operator=(operator : CompositionOperator)
Set the composition operator of this context using CompositionOperator.
Sourcefill_alpha=(alpha)
Set the fill alpha of this context.
Sourcefill_geometry(geometry : GeometryType)
Fill some geometry given a GeometryType, an abstract class that can not be initialized. Instead,
pass a deriving class, like RoundRect or Ellipse.
Sourcefill_glyph_run(point : PointI, font : Font, run : GlyphRun)
Fill some text given a PointI, Font, and GlyphRun.
Sourcefill_glyph_run(point : Point, font : Font, run : GlyphRun)
Fill some text given a Point, Font, and GlyphRun.
Sourcefill_style=(color : RGBA32)
Set the fill color of this context using a color of RGBA32.
Sourcefill_style=(color : RGBA64)
Set the fill color of this context using a color of RGBA64.
Sourcefill_style=(gradient : Gradient)
Set the fill style of this context to a Gradient.
Sourcefill_style=(pattern : Pattern)
Set the fill style of this context to a Pattern.
Sourcefill_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
Fill some text given a PointI, Font, and String.
Sourcefill_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
Fill some text given a Point, Font, and String.
Sourcefinalize
Called when Crystal's garbage collector collects this instance.
Sourceglobal_alpha=(alpha)
Set the global alpha of this context.
Sourcematrix_operation(operation : MatrixOperation, data : Array(Float64))
Apply a matrix operation (one of MatrixOperation), and pass an array of Float64s to specify parameters.
Sourcereset_matrix
Reset the context's matrix.
Sourcerestore(cookie : ContextCookie)
Restore this context from a ContextCookie.
Sourcerestore_clipping
Restore the clipping on the context.
Sourcerotate(angle : Float64, cx : Float64, cy : Float64)
Rotate the context about a point defined by two doubles.
Sourcerotate(angle : Float64, point : PointI)
Rotate the context about a point.
Sourcerotate(angle : Float64, point : Point)
Rotate the context about a point.
Sourcesave
Save this context into a ContextCookie.
Sourcescale(x : Float64, y : Float64)
Scale the context's matrix by (x, y).
Sourcescale(factor : Float64)
Scale the context's matrix by a factor equivalent for both x and y.
Sourceset_stroke_cap(position : StrokeCapPosition, cap : StrokeCap)
Set one of the context's stroke caps, given a StrokeCapPosition and a StrokeCap.
Sourceskew(x : Float64, y : Float64)
Skew the context's matrix by (x, y).
Sourcestroke_alpha=(alpha)
Set the stroke alpha of this context.
Sourcestroke_caps=(cap : StrokeCap)
Set both of the context's stroke caps given a StrokeCap.
Sourcestroke_dash_offset=(dash_offset)
Set the stroke dash offset.
Sourcestroke_end_cap=(cap : StrokeCap)
Equivalent to #set_stroke_cap, passing StrokeCapPosition::End as the first argument.
Sourcestroke_geometry(geometry : GeometryType)
Stroke some geometry given a GeometryType, an abstract class that can not be initialized. Instead,
pass a deriving class, like RoundRect or Ellipse.
Sourcestroke_glyph_run(point : PointI, font : Font, run : GlyphRun)
Stroke some text given a PointI, Font, and GlyphRun.
Sourcestroke_glyph_run(point : Point, font : Font, run : GlyphRun)
Stroke some text given a Point, Font, and GlyphRun.
Sourcestroke_join=(join : StrokeJoin)
Set the stroke join method.
Sourcestroke_miter_limit=(miter_limit)
Set this context's miter limit.
Sourcestroke_options
Fetch the context's stroke options.
Sourcestroke_options=(options : StrokeOptions)
Set the context's stroke options. It must first be fetched using #stroke_options.
Sourcestroke_path(path : Path)
Sourcestroke_rect(rect : RectI)
Sourcestroke_rect(rect : Rect)
Sourcestroke_start_cap=(cap : StrokeCap)
Equivalent to #set_stroke_cap, passing StrokeCapPosition::Start as the first argument.
Sourcestroke_style=(color : RGBA32)
Set the stroke color of this context.
Sourcestroke_style=(color : RGBA64)
Set the stroke color of this context.
Sourcestroke_style=(gradient : Gradient)
Set the stroke style of this context to a Gradient.
Sourcestroke_style=(pattern : Pattern)
Set the stroke style of this context to a Pattern.
Sourcestroke_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
Stroke some text given a PointI, Font, and String.
Sourcestroke_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
Stroke some text given a Point, Font, and String.
Sourcestroke_width=(width)
Set this context's stroke width.
Sourcetranslate(x : Float64, y : Float64)
Translate the context's matrix by (x, y).
Sourcetranslate(point : PointI)
Translate the context's matrix by the point's coordinates.
Sourcetranslate(point : Point)
Translate the context's matrix by the point's coordinates.
Source