CopyArrayToPixMask

Declaration: TMetaData.CopyArrayToPixMask(PixArray: TInt2DArray; TransferMask: integer): integer;
Copies parts of the array PixArray into the collection of pixel masks. The integer array PixArray is interpreted as 32 masks, each mask being represented by a particular bit of the integer cell values. Which pixel masks are affected is controlled by the parameter TransferMask. All bits of TransferMask which are set to 1 cause the corresponding pixel mask to be copied from PixArray to the pixel mask collection.

For example, the statement CopyArrayToPixelMask (AnArray, $00000205); copies the pixel masks 1, 3 and 10 from the integer array AnArray to the set of pixel masks because the TransferMask parameter has the bits 1, 3 and 10 set to 1 ($00000205 = ...0000001000000101).

The function returns the following error codes:

 0 .... everything OK
-1 ... the size of PixArray does not match the size of the pixel matrix

Hint 1: Use the function DecodeBin to create the TransferMask parameter programmatically.

Hint 2: In order to directly access the metadata of the currently loaded dataset you can use the pre-declared global variable MData.