displaying PNG image | developer.brewmp.com displaying PNG image | developer.brewmp.com

Developer

displaying PNG image

Forums:

Hi all..

I am dowloading PNG file from the server successfully as binary stream. Any idea abt how to create & display image from this raw binary data?

regds,
Nilesh

Hello nileshbhanderi,
You can use the IDisplay Interface to Display the PNG file provided the PNG file must be decoded to the RAW RGB.
I think you have to wite a PNG decoder youself.
good luck

Hello nileshbhanderi,
You can use the IDisplay Interface to Display the PNG file provided the PNG file must be decoded to the RAW RGB.
I think you have to wite a PNG decoder youself.
good luck

you can write your binary data to an png file and then load it to an IImage object.

you can write your binary data to an png file and then load it to an IImage object.

hello tuya,
Quote:you can write your binary data to an png file and then load it to an IImage object.
when the BREW does not support the displaying the PNG files directly and you have to deocde the PNG file. then what is the pont to write the data in to the PNG file and reading the PNG file.

hello tuya,
Quote:you can write your binary data to an png file and then load it to an IImage object.
when the BREW does not support the displaying the PNG files directly and you have to deocde the PNG file. then what is the pont to write the data in to the PNG file and reading the PNG file.

Thanks to all..
I solved the problem...
Following is the code
<<<<<<<<<<<
pMe->m_pBinImage[pMe->nLenImage] = '\0'; //my binary image data
//AEECLSID_PNG
if(AEE_SUCCESS != ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_PNG,(void **)&pMe->m_pIImage))
return ;
if(pMe->m_pIImage)
{
IMemAStream* pIMemAStream = NULL;
if(AEE_SUCCESS != ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_MEMASTREAM,(void **)&pIMemAStream))
return ;
if(pIMemAStream)
{
IMEMASTREAM_Set(pIMemAStream, (void *)pMe->m_pBinImage, pMe- >nLenImage, 0, 0);
IIMAGE_SetStream(pMe->m_pIImage, (IAStream *)pIMemAStream);
IIMAGE_Draw(pMe->m_pIImage, 5, 5);
IDISPLAY_UpdateEx(pMe->a.m_pIDisplay, TRUE);
}
IMEMASTREAM_Release(pIMemAStream);
pIMemAStream = NULL;

>>>>>>>>>>>>>>>>>>>>>
regds,
Nilesh

Thanks to all..
I solved the problem...
Following is the code
<<<<<<<<<<<
pMe->m_pBinImage[pMe->nLenImage] = '\0'; //my binary image data
//AEECLSID_PNG
if(AEE_SUCCESS != ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_PNG,(void **)&pMe->m_pIImage))
return ;
if(pMe->m_pIImage)
{
IMemAStream* pIMemAStream = NULL;
if(AEE_SUCCESS != ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_MEMASTREAM,(void **)&pIMemAStream))
return ;
if(pIMemAStream)
{
IMEMASTREAM_Set(pIMemAStream, (void *)pMe->m_pBinImage, pMe- >nLenImage, 0, 0);
IIMAGE_SetStream(pMe->m_pIImage, (IAStream *)pIMemAStream);
IIMAGE_Draw(pMe->m_pIImage, 5, 5);
IDISPLAY_UpdateEx(pMe->a.m_pIDisplay, TRUE);
}
IMEMASTREAM_Release(pIMemAStream);
pIMemAStream = NULL;

>>>>>>>>>>>>>>>>>>>>>
regds,
Nilesh