Quick tutorial:
SCAR Code:
function CountItems(identifier: Integer; identifiertype: string; tol: TIntegerArray): Integer;
Identifer is the variable that holds the bmp, bitmap mask, dtm or colour of the item you're searching for.
IdentifierType is the type of identifier obviously, that is 'dtm', 'bmp', 'bmpmask', 'color'.
Tol is an array of integers that contains information on the tolerance and the contour tolerance (in the case of bitmap masks). The length of this array can range from 0 for dtms (dtms do no need tolerance), 1 for colour and bitmaps where the value is the tolerance of the colour and the bitmap or 2 for bitmap masks where the first value is the bmp tolerance and the second value is the contour tolerance.
Examples:
DTMS:
SCAR Code:
ItemCount := CountItems(DTM, 'dtm', []); //array length is 0
Colour:
SCAR Code:
ItemCount := CountItems(65536, 'color', [10]);
Bitmaps:
SCAR Code:
ItemCount := CountItem(BMP, 'bmp' , [50]);
Bitmap Masks:
SCAR Code:
ItemCount := CountItem(BMPMask, 'bmpmask', [50, 10]);