Skip to content

LoadBuffer

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

Blitz3DBlitzPlusBlitzBasic

LoadBuffer

LoadBuffer:Int32 buffer:Int32, bmpfile:String
Parameter Mode Type Default Description
buffer In Int32 required The buffer to fill.
bmpfile In String required The path of the picture file.

Returns: 1 if the picture was loaded, otherwise 0.

Description

Loads a picture file into a buffer, stretched to cover all of it. Returns whether the file could be loaded.

Differences

  • Formats other than BMP load as well, but not JPEG 2000 or TIFF with Deflate or JPEG compression, see Image formats. The picture is always scaled to the size of the buffer, with smooth filtering.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
; Save the screen of the first part to a file and load it again, stretched into a smaller image.
Color 255, 120, 0
Oval 20, 20, 200, 200, 1
SaveBuffer BackBuffer(), "shot.bmp"
Cls
Local small = CreateImage(64, 64)
If LoadBuffer(ImageBuffer(small), "shot.bmp") Then DrawBlock small, 128, 88
Flip
WaitKey

Related Commands

BackBuffer, BufferDirty, FrontBuffer, GraphicsBuffer, LockBuffer, SaveBuffer, SetBuffer, UnlockBuffer

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally