CrImage::ClipContext
Inherits Reference / Object
ClipContext provides a clipping region for drawing operations.
When drawing within a clip context, all operations are restricted to the specified rectangular region. Pixels outside the region are not modified.
Example:
img = CrImage.rgba(400, 300, CrImage::Color::WHITE)
# Draw within a clipped region
img.with_clip(50, 50, 200, 150) do
# This circle will be clipped to the 200x150 region
img.draw_circle(100, 100, 80, color: CrImage::Color::RED, fill: true)
end
Constructors
Instance methods
clip_rect
Sourceimage
Sourceoriginal_bounds
Source