module

Draw::GraphicContext

Inherits Draw::PathBuilder

Instance methods

begin_path

Creates a new path

Source
clear

Fills the current canvas with a default transparent color

Source
clear_rect(x1 : Int32, y1 : Int32, x2 : Int32, y2 : Int32)

Fills the specified rectangle with a default transparent color

Source
compose_matrix_transform(tr : Draw::Matrix)

Composes the current transformation matrix with tr

Source
create_string_path(text : String, x : Float64, y : Float64) : Float64

Creates a path from the string s at x, y

Source
dpi(dpi : Int32)

Sets the current DPI

Source
dpi

Gets the current DPI

Source
fill(*paths : Draw::Path)

Fills the paths with the color specified by fill_color

Source
fill_color(c : Colorize::Color)

Sets the current fill color

Source
fill_rule(f : Draw::FillRule)

Sets the current fill rule

Source
fill_string(text : String) : Float64

Draws the text at point (0, 0)

Source
fill_string_at(text : String, x : Float64, y : Float64) : Float64

Draws the text at the specified point (x, y)

Source
fill_stroke(*paths : Draw::Path)

First fills the paths and than strokes them

Source
font_data(font_data : Draw::FontData)

Sets the current FontData

Source
font_data

Gets the current FontData

Source
font_name

Gets the current FontData as a string

Source
font_size(font_size : Float64)

Sets the current font size

Source
font_size

Gets the current font size

Source
line_cap(cap : Draw::LineCap)

Sets the current line cap

Source
line_dash(dash : Array(Float64), dash_offset : Float64)

Sets the current dash

Source
line_join(join : Draw::LineJoin)

Sets the current line join

Source
line_width(line_width : Float64)

Sets the current line width

Source
matrix_transform(tr : Draw::Matrix)

Sets the current transformation matrix

Source
matrix_transform

Returns the current transformation matrix

Source
path

Copies the current path, then returns it

Source
restore

Remove the current context and restore the last one

Source
save

Draws the raster image in the current canvas abstract def draw_image(image image.Image) Save the context and push it to the context stack

Source
scale(sx : Float64, sy : Float64)

Applies a scale to the current transformation matrix.

Source
string_bounds(s : String) : Tuple(Float64, Float64, Float64, Float64)

Gets pixel bounds(dimensions) of given string

Source
stroke(*paths : Draw::Path)

Strokes the paths with the color specified by stroke_color

Source
stroke_color(c : Colorize::Color)

Sets the current stroke color

Source
stroke_string(text : String) : Float64

Draws the contour of the text at point (0, 0)

Source
stroke_string_at(text : String, x : Float64, y : Float64) : Float64

Draws the contour of the text at point (x, y)

Source
totate(angle : Float64)

Applies a rotation to the current transformation matrix. angle is in radian.

Source
translate(tx : Float64, ty : Float64)

Applies a translation to the current transformation matrix.

Source