b2dGrabImage

Category: 2D Overlay

Syntax:

b2dGrabImage:Int(x1:Int, y1:Int, x2:Int, y2:Int)


Parameters

Returns

Int



Summary

Captures rectangle from active render target (returns new image, requires b2dFlush first, RT only not backbuffer).

Takes x1 (left edge of capture region in pixels, integer), y1 (top edge of capture region in pixels, integer), x2 (right edge of capture region in pixels, integer, 0=use full width from x1), y2 (bottom edge of capture region in pixels, integer, 0=use full height from y1).

Returns new image handle (positive integer, captured region as new image), returns 0 on failure (invalid RT, empty region, or backbuffer capture attempted).

View detailed documentation online



Example

;No example implemented yet


BambooBasic © 2026 Michael Denathorn