class

Blend2D::Rendering::Context

Inherits Blend2D::BLStructure < Reference < Object

Constructors

new(image : Image)

Initialize the context using the given Image.

Source

Instance methods

blit(image : Image, point : PointI, area : RectI | Nil = nil)

Blit an image onto the canvas.

Source
blit(image : Image, point : Point, area : RectI | Nil = nil)

Blit an image onto the canvas.

Source
blit(image : Image, rect : RectI, area : RectI | Nil = nil)

Blit an image onto the canvas.

Source
blit(image : Image, rect : Rect, area : RectI | Nil = nil)

Blit an image onto the canvas.

Source
clear_all

Clear the context.

Source
clear_rect(rect : RectI)

Clear an area of the context defined by a RectI.

Source
clear_rect(rect : Rect)

Clear an area of the context defined by a Rect.

Source
clip_to_rect(rect : RectI)

Clip the context to a RectI.

Source
clip_to_rect(rect : Rect)

Clip the context to a Rect.

Source
composition_operator=(operator : CompositionOperator)

Set the composition operator of this context using CompositionOperator.

Source
end

Ends this context.

Source
fill_all

Fill the entire context.

Source
fill_alpha=(alpha)

Set the fill alpha of this context.

Source
fill_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.

Source
fill_glyph_run(point : PointI, font : Font, run : GlyphRun)

Fill some text given a PointI, Font, and GlyphRun.

Source
fill_glyph_run(point : Point, font : Font, run : GlyphRun)

Fill some text given a Point, Font, and GlyphRun.

Source
fill_path(path : Path)

Fill a Path.

Source
fill_rect(rect : RectI)

Fill a RectI.

Source
fill_rect(rect : Rect)

Fill a Rect.

Source
fill_style=(color : RGBA32)

Set the fill color of this context using a color of RGBA32.

Source
fill_style=(color : RGBA64)

Set the fill color of this context using a color of RGBA64.

Source
fill_style=(gradient : Gradient)

Set the fill style of this context to a Gradient.

Source
fill_style=(pattern : Pattern)

Set the fill style of this context to a Pattern.

Source
fill_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)

Fill some text given a PointI, Font, and String.

Source
fill_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)

Fill some text given a Point, Font, and String.

Source
finalize

Called when Crystal's garbage collector collects this instance.

Source
global_alpha=(alpha)

Set the global alpha of this context.

Source
matrix_operation(operation : MatrixOperation, data : Array(Float64))

Apply a matrix operation (one of MatrixOperation), and pass an array of Float64s to specify parameters.

Source
reset_matrix

Reset the context's matrix.

Source
restore_clipping

Restore the clipping on the context.

Source
rotate(angle : Float64, cx : Float64, cy : Float64)

Rotate the context about a point defined by two doubles.

Source
rotate(angle : Float64, point : PointI)

Rotate the context about a point.

Source
rotate(angle : Float64, point : Point)

Rotate the context about a point.

Source
rotate(angle : Float64)

Rotate the context.

Source
save

Save this context into a ContextCookie.

Source
scale(x : Float64, y : Float64)

Scale the context's matrix by (x, y).

Source
scale(factor : Float64)

Scale the context's matrix by a factor equivalent for both x and y.

Source
set_stroke_cap(position : StrokeCapPosition, cap : StrokeCap)

Set one of the context's stroke caps, given a StrokeCapPosition and a StrokeCap.

Source
skew(x : Float64, y : Float64)

Skew the context's matrix by (x, y).

Source
stroke_alpha=(alpha)

Set the stroke alpha of this context.

Source
stroke_caps=(cap : StrokeCap)

Set both of the context's stroke caps given a StrokeCap.

Source
stroke_dash_offset=(dash_offset)

Set the stroke dash offset.

Source
stroke_end_cap=(cap : StrokeCap)

Equivalent to #set_stroke_cap, passing StrokeCapPosition::End as the first argument.

Source
stroke_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.

Source
stroke_glyph_run(point : PointI, font : Font, run : GlyphRun)

Stroke some text given a PointI, Font, and GlyphRun.

Source
stroke_glyph_run(point : Point, font : Font, run : GlyphRun)

Stroke some text given a Point, Font, and GlyphRun.

Source
stroke_join=(join : StrokeJoin)

Set the stroke join method.

Source
stroke_miter_limit=(miter_limit)

Set this context's miter limit.

Source
stroke_options

Fetch the context's stroke options.

Source
stroke_options=(options : StrokeOptions)

Set the context's stroke options. It must first be fetched using #stroke_options.

Source
stroke_path(path : Path)

Stroke a Path.

Source
stroke_rect(rect : RectI)

Stroke a RectI.

Source
stroke_rect(rect : Rect)

Stroke a Rect.

Source
stroke_start_cap=(cap : StrokeCap)

Equivalent to #set_stroke_cap, passing StrokeCapPosition::Start as the first argument.

Source
stroke_style=(color : RGBA32)

Set the stroke color of this context.

Source
stroke_style=(color : RGBA64)

Set the stroke color of this context.

Source
stroke_style=(gradient : Gradient)

Set the stroke style of this context to a Gradient.

Source
stroke_style=(pattern : Pattern)

Set the stroke style of this context to a Pattern.

Source
stroke_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)

Stroke some text given a PointI, Font, and String.

Source
stroke_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)

Stroke some text given a Point, Font, and String.

Source
stroke_width=(width)

Set this context's stroke width.

Source
transform(matrix : Matrix)

Transform the context using another matrix.

Source
translate(x : Float64, y : Float64)

Translate the context's matrix by (x, y).

Source
translate(point : PointI)

Translate the context's matrix by the point's coordinates.

Source
translate(point : Point)

Translate the context's matrix by the point's coordinates.

Source