This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, April 21, 2008 7:14:31 AM(UTC)
Groups: Registered
Posts: 2
Hello,
Can somebody help me for filling in a BITMAPHANDLE knowing a table of uchar (which represents the pixels of my image) and the size (width and height of the image).
Is it possible, using LoadMemory or LoadBitmapMemory functions ?
PS : I know that my images are 32bpp and I use Vector API in C++
Thanks in advance for your help.
Max.
#2
Posted
:
Tuesday, April 22, 2008 5:50:21 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Max,
There
different ways to do this, here are 3 of them:
1. Use
L_CreateBitmap and create a bitmap of type TYPE_USER, but you will have to do
your own memory management for the bitmap pixel data.
2. Use
L_CreateBitmap and create a bitmap to type TYPE_CONV, use the L_PutBitmapRow,
and give it the full size of the buffer, and it will copy the entire contents
of the pixel data.
3. Use
your own load function to create the bitmam. For details, see the help topic
"Working with the RAW File Filter". Here's a
quick example on how to do that:
L_SetLoadInfoCallback(MyLoadInfoCallback,
NULL);
BITMAPHANDLE
Bitmap = {0};
L_LoadBitmapMemory(pBuffer
,&Bitmap, sizeof(BITMAPHANDLE), 1, ORDER_BGRORGRAY, (pLOADFILEOPTION)NULL,
0);
L_INT
EXT_CALLBACK MyLoadInfoCallback(L_HFILE hFile, pLOADINFO pInfo, L_VOID*
pUserData)
{
pInfo->Format = FILE_RAW;
pInfo->Width = <actual width>;
pInfo->Height = <actual height>;
pInfo->BitsPerPixel = 32;
pInfo->Offset = 0;
pInfo->XResolution = 150;
pInfo->YResolution = 150;
pInfo->Flags = LOADINFO_TOPLEFT; //other
flags might be needed
return SUCCESS;
}
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.