SYS_GetBitmapCRC Function


Returns the cyclic redundancy check (CRC) value of a bitmap file.


iCRC = SYS_GetBitmapCRC (sBitmap [, sMaskFile])
Variable Description
iCRC The CRC value of the bitmap. INTEGER.
sBitmap The name of the bitmap file whose CRC value you want. STRING.
sMaskFile Optional. The name of a monochrome bitmap file that serves as a mask. STRING.


SYS_GetBitmapCRC returns the cyclic redundancy check (CRC) value of a bitmap file on disk.

The CRC value is a 32-bit integer that is a reduction of the bitmap, which you can use for fast comparisons. The CRC value includes all the bytes in the file, including the color table.

Typically, the CRC value is a "baseline" bitmap captured with CaptureBitmap that you want to compare against the CRC value for a current screen state. You get the CRC value for a bitmap captured from the screen with GetBitmapCRC.

To save time, you can compare the CRC values for two bitmaps using the GetBitmapCRC function and the SYS_GetBitmapCRC function, instead of comparing their bitmap images. However, if the CRC values of two bitmaps are the same, it does not guarantee that the images are the same. When the values are the same, it is very likely that the images are the same. Use the SYS_CompareBitmap function to determine if the images truly match.

Windows Platforms

SYS_GetBitmapCRC is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.


[ ] fileCRC = SYS_GetBitmapCRC ("image.bmp")
[-] if (SYS_GetBitmapCRC ("/Window1") != fileCRC)
	[ ] // raise an exception