QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

BLOAD loads a binary graphics file created by BSAVE to an array.

Legacy Support

Syntax

BLOAD fileName$, VARPTR(imageArray%(Parameter))

Parameter(s)

Description

Example(s)

Loading data to an array from a BSAVED file.


DEF SEG = VARSEG(Array(0))
  BLOAD filename$, VARPTR(Array(LBOUND(Array))) ' changeable index
DEF SEG 

Explanation: Referance any type of array that matches the data saved. Can work with Integer, Single, Double, Long, fixed length Strings or TYPE arrays. LBOUND determines the starting offset of the array or another index could be used.

Using a QB default colored image.


DEF SEG = VARSEG(Image%(0)) ' pointer to first image element of an array
  BLOAD FileName$, VARPTR(Image%(0)) ' place data into array at index position 0
  PUT(Col, Row), Image%(0), PSET ' Put the image on the screen from index 0
DEF SEG 

Note: PSET is used as a PUT (graphics statement) action that places the image over any background objects.

See Also