IMAGE

IMAGE N

CREATES A SYSTEM OBJECT IMAGE AND ALLOCATES IT NUMBER N AS REFERENCE

  • Type: Command
  • Parameter: 1
  • Group: System Objects Creation

ACTION

The command IMAGE N creates a system object IMAGE, and allocates it a number N. An IMAGE is a picture in memory. The number N will be used to designate the IMAGE.

The created IMAGE can then be used through the appropriated commands.

An IMAGE can load a picture in memory (a bitmap file BMP) with command FILE_LOAD.

An IMAGE can load a picture in memory by grabbing the screen with the command 2D_IMAGE_COPY.

An IMAGE can save the picture in memory with command FILE_SAVE.

An IMAGE can display the picture in memory with command 2D_IMAGE_PASTE.

A SPRITE can display the picture from an IMAGE with command SPRITE_IMAGE_LOAD.

A 3D object can take the picture from an IMAGE as a texture with the command 3D_IMAGE_TEXTURE.

SYNTAX: IMAGE N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • A IMAGE is used to handle an image in memory, without displaying it.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than or equal to 0.
  • If number N is already used for a system object number.

EXAMPLE

rem multiply the buttons!

button 1:caption 1,"False button"

top 1,10:left 1,10

image 2

rem grab the screen

2d_image_copy 2,0,0,100,100

rem paste the screen

2d_image_paste 2,80,0

caption 1,"True button"

SEE ALSO

FILE_LOAD

FILE_SAVE

2D_IMAGE_COPY

2D_IMAGE_PASTE

SPRITE_IMAGE_LOAD

3D_IMAGE_TEXTURE