class Blend2D::Rendering::Context
- Blend2D::Rendering::Context
- Blend2D::BLStructure
- Reference
- Object
Defined in:
blend2d/rendering/context.crConstructors
-
.new(image : Image)
Initialize the context using the given Image.
Instance Method Summary
-
#blit(image : Image, point : PointI, area : RectI | Nil = nil)
Blit an image onto the canvas.
-
#blit(image : Image, point : Point, area : RectI | Nil = nil)
Blit an image onto the canvas.
-
#blit(image : Image, rect : RectI, area : RectI | Nil = nil)
Blit an image onto the canvas.
-
#blit(image : Image, rect : Rect, area : RectI | Nil = nil)
Blit an image onto the canvas.
-
#clear_all
Clear the context.
-
#clear_rect(rect : RectI)
Clear an area of the context defined by a
RectI
. -
#clear_rect(rect : Rect)
Clear an area of the context defined by a
Rect
. -
#clip_to_rect(rect : RectI)
Clip the context to a
RectI
. -
#clip_to_rect(rect : Rect)
Clip the context to a
Rect
. -
#composition_operator=(operator : CompositionOperator)
Set the composition operator of this context using
CompositionOperator
. -
#end
Ends this context.
-
#fill_all
Fill the entire context.
-
#fill_alpha=(alpha)
Set the fill alpha of this context.
-
#fill_geometry(geometry : GeometryType)
Fill some geometry given a
GeometryType
, an abstract class that can not be initialized. - #fill_glyph_run(point : PointI, font : Font, run : GlyphRun)
- #fill_glyph_run(point : Point, font : Font, run : GlyphRun)
-
#fill_path(path : Path)
Fill a
Path
. -
#fill_rect(rect : RectI)
Fill a
RectI
. -
#fill_rect(rect : Rect)
Fill a
Rect
. -
#fill_style=(color : RGBA32)
Set the fill color of this context using a color of
RGBA32
. -
#fill_style=(color : RGBA64)
Set the fill color of this context using a color of
RGBA64
. -
#fill_style=(gradient : Gradient)
Set the fill style of this context to a
Gradient
. -
#fill_style=(pattern : Pattern)
Set the fill style of this context to a
Pattern
. - #fill_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
- #fill_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
-
#finalize
Called when Crystal's garbage collector collects this instance.
-
#global_alpha=(alpha)
Set the global alpha of this context.
-
#matrix_operation(operation : MatrixOperation, data : Array(Float64))
Apply a matrix operation (one of
MatrixOperation
), and pass an array ofFloat64
s to specify parameters. -
#reset_matrix
Reset the context's matrix.
-
#restore(cookie : ContextCookie)
Restore this context from a
ContextCookie
. -
#restore_clipping
Restore the clipping on the context.
-
#rotate(angle : Float64, cx : Float64, cy : Float64)
Rotate the context about a point defined by two doubles.
-
#rotate(angle : Float64, point : PointI)
Rotate the context about a point.
-
#rotate(angle : Float64, point : Point)
Rotate the context about a point.
-
#rotate(angle : Float64)
Rotate the context.
-
#save : ContextCookie
Save this context into a
ContextCookie
. -
#scale(x : Float64, y : Float64)
Scale the context's matrix by (x, y).
-
#scale(factor : Float64)
Scale the context's matrix by a factor equivalent for both x and y.
-
#set_stroke_cap(position : StrokeCapPosition, cap : StrokeCap)
Set one of the context's stroke caps, given a
StrokeCapPosition
and aStrokeCap
. -
#skew(x : Float64, y : Float64)
Skew the context's matrix by (x, y).
-
#stroke_alpha=(alpha)
Set the stroke alpha of this context.
-
#stroke_caps=(cap : StrokeCap)
Set both of the context's stroke caps given a
StrokeCap
. -
#stroke_dash_offset=(dash_offset)
Set the stroke dash offset.
-
#stroke_end_cap=(cap : StrokeCap)
Equivalent to
#set_stroke_cap
, passingStrokeCapPosition::End
as the first argument. -
#stroke_geometry(geometry : GeometryType)
Stroke some geometry given a
GeometryType
, an abstract class that can not be initialized. - #stroke_glyph_run(point : PointI, font : Font, run : GlyphRun)
- #stroke_glyph_run(point : Point, font : Font, run : GlyphRun)
-
#stroke_join=(join : StrokeJoin)
Set the stroke join method.
-
#stroke_miter_limit=(miter_limit)
Set this context's miter limit.
-
#stroke_options
Fetch the context's stroke options.
-
#stroke_options=(options : StrokeOptions)
Set the context's stroke options.
-
#stroke_path(path : Path)
Stroke a
Path
. -
#stroke_rect(rect : RectI)
Stroke a
RectI
. -
#stroke_rect(rect : Rect)
Stroke a
Rect
. -
#stroke_start_cap=(cap : StrokeCap)
Equivalent to
#set_stroke_cap
, passingStrokeCapPosition::Start
as the first argument. -
#stroke_style=(color : RGBA32)
Set the stroke color of this context.
-
#stroke_style=(color : RGBA64)
Set the stroke color of this context.
-
#stroke_style=(gradient : Gradient)
Set the stroke style of this context to a
Gradient
. -
#stroke_style=(pattern : Pattern)
Set the stroke style of this context to a
Pattern
. - #stroke_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
- #stroke_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8)
-
#stroke_width=(width)
Set this context's stroke width.
-
#transform(matrix : Matrix)
Transform the context using another matrix.
-
#translate(x : Float64, y : Float64)
Translate the context's matrix by (x, y).
-
#translate(point : PointI)
Translate the context's matrix by the point's coordinates.
-
#translate(point : Point)
Translate the context's matrix by the point's coordinates.
Instance methods inherited from class Blend2D::BLStructure
finalize
finalize,
pointer : Pointer
pointer
Constructor Detail
Instance Method Detail
Blit an image onto the canvas.
Blit an image onto the canvas.
Blit an image onto the canvas.
Blit an image onto the canvas.
Set the composition operator of this context using CompositionOperator
.
Fill some geometry given a GeometryType
, an abstract class that can not be initialized. Instead,
pass a deriving class, like RoundRect
or Ellipse
.
Set the fill color of this context using a color of RGBA32
.
Set the fill color of this context using a color of RGBA64
.
Set the fill style of this context to a Gradient
.
Called when Crystal's garbage collector collects this instance.
Apply a matrix operation (one of MatrixOperation
), and pass an array of Float64
s to specify parameters.
Rotate the context about a point defined by two doubles.
Set one of the context's stroke caps, given a StrokeCapPosition
and a StrokeCap
.
Set both of the context's stroke caps given a StrokeCap
.
Equivalent to #set_stroke_cap
, passing StrokeCapPosition::End
as the first argument.
Stroke some geometry given a GeometryType
, an abstract class that can not be initialized. Instead,
pass a deriving class, like RoundRect
or Ellipse
.
Set the context's stroke options. It must first be fetched using #stroke_options
.
Equivalent to #set_stroke_cap
, passing StrokeCapPosition::Start
as the first argument.
Set the stroke style of this context to a Gradient
.
Set the stroke style of this context to a Pattern
.
Translate the context's matrix by the point's coordinates.
Translate the context's matrix by the point's coordinates.