04-08-2007, 12:49
|
Adnan Ismail

Joined on 07-31-2006
Posts 1,318
|
Re: Betreft: Re: Betreft: Re: LGRY
|
 
 
|
|
|
Slager,
I managed to load the bitmap directly into my own buffer without using the callback or making a copy operation using the following code:
static unsigned char myBuffer[20*1024]; memset(myBuffer, 200, sizeof(myBuffer)); L_INT nRet = L_CreateBitmap(&Bitmap, sizeof(Bitmap), TYPE_USER, 90, 72, 24, ORDER_BGR, NULL, TOP_LEFT, myBuffer, sizeof(myBuffer)); InvalidateRect(hWnd, 0, TRUE); MessageBox(hWnd, "Before Loading. Should be light gray", "Test User Buffer", MB_OK); nRet = L_LoadFile("I:\\TestFolder\\small2.bmp", &Bitmap, sizeof(Bitmap), 0, ORDER_BGR, LOADFILE_NOINITBITMAP | LOADFILE_STORE, 0, 0, 0, 0); InvalidateRect(hWnd, 0, TRUE); MessageBox(hWnd, "After Loading", "Test User Buffer", MB_OK);
L_AccessBitmap(&Bitmap); memset(myBuffer, 70, sizeof(myBuffer)); L_ReleaseBitmap(&Bitmap);
InvalidateRect(hWnd, 0, TRUE); MessageBox(hWnd, "After filling with dark gray", "Test User Buffer", MB_OK);
Adnan Ismail LEADTOOLS Technical Support
|
|
|
|
|
Report
|
|
|
|