Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: L_LoadMemory success but no image displayed
Started by MaJic at 05-26-2008 3:55. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
  05-26-2008, 3:55
MaJic is not online. Last active: 6/21/2008 8:12:19 AM MaJic

Not Ranked
Joined on 05-26-2008
Posts 2
L_LoadMemory success but no image displayed
Reply Quote
Hi,

I have the below C++ code for L_LoadMemory using LeadTools Mobile Imaging v14.5.
The function is trying to load a JPEG file from memory and it returns SUCCESS. However, no image is seen on the display. Did I miss something out?

Also I notice that the databuffer contents is entirely changed after L_LoadMemory is executed. Is it suppose to be so?


bool FPPicture::SetDisplayFromMemory(byte *databuffer, size_t databuffer_size)
{
     int nRet = L_LoadMemory(databuffer, &m_Bitmap,sizeof(BITMAPHANDLE),
                                 0,
                                 ORDER_BGRORGRAY,
                                 LOADFILE_STORE | LOADFILE_ALLOCATE | LOADFILE_COMPRESSED,
                                 NULL,
                                 NULL,
                                 databuffer_size,
                                 NULL,
                                 NULL);

   if (nRet!=SUCCESS)
    {
        CString msg;
        msg.Format(_T("Error: %d"),nRet);
        MessageBox(msg, L"SetDisplayFromMemory");
        return false;
    }

    return true;
}
   Report 
  05-26-2008, 10:20
Qasem Lubani is not online. Last active: 7/16/2008 2:06:19 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,020
Re: L_LoadMemory success but no image displayed
Reply Quote

Does this mean the image gets loaded correctly into the m_Bitmap BITMAPHANDLE structure? If yes, are you painting this bitmap using L_PaintDC or some other painting function?

About the memory buffer contents, they are not supposed to get changed unless your code has some out-of-bounds writing problems.


Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  05-27-2008, 2:25
MaJic is not online. Last active: 6/21/2008 8:12:19 AM MaJic

Not Ranked
Joined on 05-26-2008
Posts 2
Re: L_LoadMemory success but no image displayed
Reply Quote
Yes the BITMAPHANDLE structure is loaded correctly. Got it working after calling L_PaintDC. Thanks

Still trying to debug why the memory buffer contents get changed.

   Report 
Post
LEAD Support Fo... » Developer » Image Display » Re: L_LoadMemory success but no image displayed

Powered by Community Server, by Telligent Systems