Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, April 21, 2008 7:19:31 AM(UTC)
maximepinchon

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.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, April 22, 2008 5:55:21 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 1 time(s) in 1 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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.223 seconds.