The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



SaveArrayAsImg


Unit:SDL_openarrays
Class: none
Declaration: function SaveArrayAsImg (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 1: Please keep in mind that the creation of the image can take considerable time if the MagFact is high.

Hint 2: The function SaveArrayAsImg not supported under Delphi 6 and 7.



Last Update: 2023-Feb-06