DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Declaration: SaveMatrixAsImg (FName: string; Data: TInt2DArray; MagFact: integer): integer;
Saves the data contained in the integer matrix Data as an image assuming that the matrix cells are corresponding to the pixels of the image. The least significant three bytes of each integer value of the Data array are interpreted as RGB values. The parameter FName specifies the filename of the stored image. Currently the following file types are supported: BMP, JPG and PNG. If FName is left empty the image is copied to the clipboard.

The parameter MagFact is an integer magnification factor and may assume values between 1 and 10.

The function returns the following error codes:

 0 ... everything OK
-1 ... unknown file format
-2 ... invalid MagFact (valid range: 1..10)

Hint: Please keep in mind that the creation of the image can take considerable time if the MagFact is high.