Available on: all targets
See also: PUT BITMAP

PUT IMAGE

This function draws an image at a specific position on the screen. The programmer can draw on the screen a single image (IMAGE), a frame of a series of images (IMAGES) or a frame of a pose of a sequence of images (SEQUENCES). In all cases the syntax changes slightly.

This function draws an image at a specific position on the screen. The programmer can draw on the screen a single image (IMAGE), a frame of a series of images (ATLAS) or a frame of a strip of a sequence of images (SEQUENCE). In all cases the syntax changes slightly.

Every PUT IMAGE can be followed by a flag that modify the wayt the image will be drawn on the screen. The WITH TRANSPARENCY will enable the transparency effect when the image is drawn, while DOUBLE Y will double the vertical size of the image. Both flags could be not available on all targerts and graphical modes.

Another syntax is more compatible with other BASICs, that requires that the PUT IMAGE is followed with the bounds to draw to. This is only a syntatic equivalence, there is no "clipping" around the bounds. Moreover, it is possible to give a flag that alter the default behaviour of PUT IMAGE. The PSET is the standard behaviour of PUT IMAGE, while PRESET will put only the bitmap part of the image (if possible). The AND and OR flags will activate the same logical operation between the image and the background. NOT is not currently supported.

SYNTAX

 PUT IMAGE resource AT [x],[y]
 PUT IMAGE resource FRAME frame AT [x],[y]
 PUT IMAGE resource STRIP sequence FRAME frame AT [x],[y]
 PUT IMAGE resource [ AT [x],[y] ] [fl]
 PUT IMAGE resource FRAME f [ AT [x],[y] ] [fl]
 PUT IMAGE resource STRIP s FRAME f [ AT [x],[y] ] [fl]
   fl: [WITH TRANSPARENCY] [DOUBLE Y]
 PUT ([x1],[y1])-(x2,y2),resource[,fl2]
   fl2: PSET|PRESET|AND|OR|NOT


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 PUT IMAGE airplane AT 10,10


Used in:

ABBREVIATION: PuIm

Join BASIC 10Liner Contest with ugBASIC!

An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest. It is possible to use ugBASIC to participate in the next "BASIC10Liner" competition, in the following categories:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

PUT IMAGE ↔ PuIm

Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS