virtual L_INT LBitmapBase::Allocate(nMemoryType=TYPE_CONV)
Allocates memory for the bitmap data.
The type of memory to be used when allocating memory for the bitmap data. Possible values are:
Value | Meaning |
---|---|
TYPE_CONV | [0x0001] Use conventional memory if the image will fit, otherwise swap to disk. |
TYPE_USER | [0x0002] Create a bitmap where the user maintains the data pointer. |
TYPE_TILED | [0x0004] Create tiled bitmaps. |
TYPE_NOTILED | [0x0008] Do not create tiled bitmaps, even if the conventional memory has failed. |
TYPE_DISK | [0x0080] Do not use conventional memory. Swap to disk only. |
TYPE_NODISK | [0x0100] Do not swap to disk using LEAD's virtual memory. Windows virtual memory is not affected. |
TYPE_COMPRESSED | [0x0200] (Document/Medical only) Allocate an RLE-compressed bitmap. This flag can be used with TYPE_CONV or TYPE_NODISK. For more information, refer to Speeding Up 1-Bit Documents. |
TYPE_SUPERCOMPRESSED | [0x0400] (Document/Medical only) Keep images compressed in memory. This option causes slow access, but very low memory usage. This option is available only for 1-bit, 8-bit grayscale and 24-bit images. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The amount of memory allocated depends on the size of the image indicated in the internal bitmap handle (Width, Height, and BitsPerPixel). LBitmapBase::Initialize must be called prior to calling this function.
This is a low-level function that is used only when you create a bitmap from scratch using LBitmapBase::Initialize. Normally, the functions that load or create a bitmap allocate the required memory for you. (In that case, calling Allocate() causes your application to lose memory.)
Win32, x64.
L_INT LBitmapBase__AllocateExample()
{
L_INT nRet;
LBitmapBase MyBitmap;
nRet =MyBitmap.Initialize(100,200,24);
if(nRet !=SUCCESS)
return nRet;
nRet =MyBitmap.Allocate(TYPE_CONV);
if(nRet !=SUCCESS)
return nRet;
if(MyBitmap.IsAllocated())
nRet = MyBitmap.Free();
return nRet;
}
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