Blitz:Image.include.ab3

From Amiga Coding
Revision as of 14:28, 25 January 2018 by Daedalus (talk | contribs)
Jump to: navigation, search

The image.include.ab3 Include file contains some very useful procedures for loading, saving, manipulating and displaying images. Note that using this include requires an RTG system (P96 or CGX) to be installed even if running your program on a native Amiga screenmode.

Loading and Saving

image_Load

This function loads any image that is supported by a currently installed datatype. It can also load PNG and ARGB images directly. Only two arguments are required, however a number of optional arguments allow extra control over the image loading process:

succ.l = image_Load{0, "Files:Graphics/image1.png"}

This will load the specified file into image object ID 0. The returned value will tell you if loading of the image was successful or not. Additional parameters that can be used are:

- trgb.l: The RGB value that should be taken as transparent. Can be given in hex representation, e.g. $FF0000 for 100% red

- tolerance.l: How close the colour needs to be to trgb to be taken as transparent. 0 means only exactly the specified value and is the default if not specified.

- dithermode.l: Specify a dither mode for using 24-bit images on 8- or 16-bit screens. See the image_Dither procedure for possible values for this parameter.