Skip to content

iffmakelib

These commands write the Amiga’s standard IFF formats, so that a paint program or another Blitz program can load the result. SaveBitmap, SaveScreen and SaveShape write IFF ILBM pictures, packed with the usual ByteRun1 compression; with a palette, the file also holds the colours. SavePalette writes only the colours. All four work in Amiga mode only, and a file that cannot be created is the error “Can’t open File”.

SaveBitmap 0,"RAM:picture.iff",0

The files follow the IFF rules, so strict readers such as programs that use iffparse.library load them too: a colour chunk of an odd number of colours is followed by its pad byte. That makes these files one byte longer than the ones the original writes, and a packed row can differ from the original’s; the picture and the colours are the same (#184, #183).

Based on the iffmakelib guide by Acid Software.

Library number 114.

Commands

SaveBitmap

Saves a bitmap as an IFF ILBM picture, with the colours of Palette# if it is given. Amiga mode only.

Statement. Help text: BitMap#,Filename$[,Palette#]
2 forms:

  • .w, $
  • .w, $, .w

With runtime error checking, a palette without colours, such as one made with InitPalette p,0, is the error “Uninitialized Palette”.

SavePalette

Saves the colours of a palette as an IFF colour map chunk (CMAP), three bytes per colour, without an IFF FORM around it. Nothing is written for a palette without colours. Amiga mode only.

Statement. Help text: Palette#,Filename$
Arguments: .w, $

SaveScreen

Saves a screen as an IFF ILBM picture, with its colours (at most 256). Amiga mode only.

Statement. Help text: Screen#,Filename$
Arguments: .w, $

SaveShape

Saves a shape as an IFF ILBM picture of the shape’s size, with the colours of Palette# if it is given. Amiga mode only.

Statement. Help text: Shape#,Filename$[,Palette#]
2 forms:

  • .w, $
  • .w, $, .w

A shape of depth 0 or of more than 14 planes, such as one LoadShape made from a 24-bit picture, is the error “Illegal Shape Depth”, also without runtime error checking. With runtime error checking, a palette without colours is the error “Uninitialized Palette”.