virtual L_INT LBitmap::Scramble (nColStart, nRowStart, nWidth, nHeight, uKey, uFlags)
Scrambles all or a portion of a bitmap.
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:
Value | Meaning |
---|---|
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 rect with the bitmap's rect. |
Value | Meaning |
---|---|
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 nColStart, nRowStart, nWidth, nHeight) and the same key, setting (uFlags = SB_ENCRYPT) is the inverse of (uFlags = SB_DECRYPT)
Win32, x64.
L_INT LBitmap__ScrambleExample(LBitmap *pLBitmap)
{
if (!pLBitmap->IsAllocated())
return FAILURE;
return pLBitmap->Scramble(0,
0,
pLBitmap->GetWidth()/2,
pLBitmap->GetHeight()/2,
123,
SB_ENCRYPT);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document