L_LTKRN_API L_INT L_ScrambleBitmap(pBitmap, nColStart, nRowStart, nWidth, nHeight, uKey, uFlags)
Scrambles all or a portion of a bitmap.
Pointer to a bitmap handle for the bitmap to be scrambled.
Starting column in pixels (0-based).
Starting row in pixels (0-based).
Width of area to scramble in pixels.
Height of area to scramble in pixels.
Key that determines the scramble. This is an unsigned integer with a minimum value of 0 and a maximum value of 4294967295 (0xffffffff).
Flag that determines whether to encrypt or decrypt the area. Possible values are:
|SB_ENCRYPT||Encrypts the area (the reverse of a decrypt).|
|SB_DECRYPT||Decrypts the area (the reverse of an encrypt).|
|SB_INTERSECT||Intersect the specified rectangle with the bitmaps rectangle.|
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
Scrambling a rectangular area means that the pixels in that area are shuffled around into a pseudo-random location within the area.
Some properties of shuffling:
No colors are introduced,
Color counts remain unchanged
Given the same encrypt area (defined by
nHeight) and the same key, setting (
uFlags = SB_ENCRYPT) is the inverse of (uFlags = SB_DECRYPT)
Required DLLs and Libraries
Win32, x64, Linux.
This example scrambles the upper left quadrant of a bitmap using the key 123
L_INT ScrambleBitmapExample(pBITMAPHANDLE pBitmap)
nRet = L_ScrambleBitmap(pBitmap, 0, 0, BITMAPWIDTH(pBitmap)/2, BITMAPHEIGHT(pBitmap)/2, 123, SB_ENCRYPT);
if(nRet != SUCCESS)
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries