CrImage::Draw::Path
Inherits Reference / Object
Path is an SVG-like path builder for complex shapes.
Supports move_to, line_to, quadratic bezier, cubic bezier, and close commands. Paths can be filled or stroked.
Example:
path = CrImage::Draw::Path.new
.move_to(100, 100)
.line_to(200, 100)
.bezier_to(250, 100, 250, 150, 200, 150)
.line_to(100, 150)
.close
CrImage::Draw.fill_path(img, path, CrImage::Color::RED)
Constructors
new(segments_per_curve : Int32 = 32)
SourceInstance methods
bezier_to(c1x : Number, c1y : Number, c2x : Number, c2y : Number, x : Number, y : Number) : self
Draw a cubic bezier curve to (x, y) with control points (c1x, c1y) and (c2x, c2y).
commands
Sourcecubic_to(c1x : Number, c1y : Number, c2x : Number, c2y : Number, x : Number, y : Number) : self
Alias for bezier_to
quadratic_to(cx : Number, cy : Number, x : Number, y : Number) : self
Draw a quadratic bezier curve to (x, y) with control point (cx, cy).