Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Is it possible to show image on menu reading from a web page?
If yes then how
Thanks
Pramod

HI Sukumar
Thanks for ur reply. I know I can show Image on menu by using resource file. but I want a image to be shown from a web page. can I do that?
pramod

HI Sukumar
Thanks for ur reply. I know I can show Image on menu by using resource file. but I want a image to be shown from a web page. can I do that?
pramod

youd have to download the data into a memory buffer (using IWeb or ISocket), then create an MemAStream, then use IIMAGE_SetStream(), then display it.
if you use a bitmap, you could call convertbmp on the bitmap data then display it with IDisplay_Bitblt
or you could save the buffer to a file, and then load the image from the file.
-Tyndal

youd have to download the data into a memory buffer (using IWeb or ISocket), then create an MemAStream, then use IIMAGE_SetStream(), then display it.
if you use a bitmap, you could call convertbmp on the bitmap data then display it with IDisplay_Bitblt
or you could save the buffer to a file, and then load the image from the file.
-Tyndal

Hi Tyndel
Sorry for bothering you again. I am using I socket/Iweb to read file. let say http://www.pramod.com/pramod.bmp
It shows me junk values. perhaps it is reading the binary data
and showing the binary data. is there any example available in the forum for help which read image from website?
pramod

Hi Tyndel
Sorry for bothering you again. I am using I socket/Iweb to read file. let say http://www.pramod.com/pramod.bmp
It shows me junk values. perhaps it is reading the binary data
and showing the binary data. is there any example available in the forum for help which read image from website?
pramod

if you are downloading the image correctly into "rawData", you should be able to do something like:
boolean realloc;
AEEImageInfo info;
void * convData;
// convert the bitmap to the device specific format
convData=CONVERTBMP(rawData,&(info),&(realloc));
if (convData == NULL)
{
DBGPRINTF("CONVERTBMP FAILED!!! ");
return FALSE;

// if CONVERTBMP allocated new memory for the conversion free the raw data
if (realloc == TRUE)
{
if (rawData !=NULL)
{
FREEIF(rawData);
rawData=NULL;
}

IDISPLAY_BitBlt(pApp->pDisplay, x, y, info.cx, info.cy, convData,0,0,AEE_RO_TRANSPARENT);
// cleanup
if (realloc == TRUE)
{
if (convData!=NULL)
SYSFREE(convData);
convData=NULL;
realloc=FALSE;

if (rawData != NULL)
{
FREEIF(rawData);
rawData=NULL;
convData=NULL;
realloc=FALSE;

assuming you are using a small image.
if you are not sure if the data is downloading correctly. just save it to a file, and outside of brew check the file against the original.
i didnt test this code explicitly, but it should work.
-Tyndal

if you are downloading the image correctly into "rawData", you should be able to do something like:
boolean realloc;
AEEImageInfo info;
void * convData;
// convert the bitmap to the device specific format
convData=CONVERTBMP(rawData,&(info),&(realloc));
if (convData == NULL)
{
DBGPRINTF("CONVERTBMP FAILED!!! ");
return FALSE;

// if CONVERTBMP allocated new memory for the conversion free the raw data
if (realloc == TRUE)
{
if (rawData !=NULL)
{
FREEIF(rawData);
rawData=NULL;
}

IDISPLAY_BitBlt(pApp->pDisplay, x, y, info.cx, info.cy, convData,0,0,AEE_RO_TRANSPARENT);
// cleanup
if (realloc == TRUE)
{
if (convData!=NULL)
SYSFREE(convData);
convData=NULL;
realloc=FALSE;

if (rawData != NULL)
{
FREEIF(rawData);
rawData=NULL;
convData=NULL;
realloc=FALSE;

assuming you are using a small image.
if you are not sure if the data is downloading correctly. just save it to a file, and outside of brew check the file against the original.
i didnt test this code explicitly, but it should work.
-Tyndal

Hi Tyndel
Thanks for your quick answere. Iwill try this out and get back to you
pramod

Hi Tyndel
Thanks for your quick answere. Iwill try this out and get back to you
pramod

Thanks Tyndel. It is working fine
Pramod

Thanks Tyndel. It is working fine
Pramod