Skip to content

ImageBuffer

Narta Xaymar Dirks edited this page Oct 28, 2026 · 7 revisions

Blitz3DBlitzPlusBlitzBasic

ImageBuffer

ImageBuffer:Int32 image:Int32, frame:Int32=0
Parameter Mode Type Default Description
image In Int32 required The image.
frame In Int32 0 The frame whose buffer to return. Defaults to 0.

Returns: A buffer handle for SetBuffer and the pixel commands.

Description

Returns the buffer of one frame of an image, which SetBuffer can make the target of all drawing commands. The buffer is also the one that LockBuffer and ReadPixel work on.

Differences

  • A frame number that does not exist stops the program with an error message.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local img = CreateImage(32, 32, 2)
SetBuffer ImageBuffer(img, 0)
Color 255, 0, 0
Rect 0, 0, 32, 32, 1
SetBuffer ImageBuffer(img, 1)
Color 0, 0, 255
Rect 0, 0, 32, 32, 1
SetBuffer BackBuffer()
Cls
DrawImage img, 60, 100, 0
DrawImage img, 140, 100, 1
Flip
WaitKey

Related Commands

ImageFrameDelay, ImageFrames, ImageHeight, ImageReady 〔BlitzLLVM〕, ImageRectCollide, ImageRectOverlap, ImageWidth, ImageXHandle

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally