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

Developer

Forums

Forums:

Hello everybody,

Hope u all had a great New Year! k..Here is question.. I am trying to displaying a JPEG image to the screen. I have checked that the IASteam has the correct destination. But still I am getting a blank screen. I am attaching my code and the error I get. Can anybody help me.. It is Urgent.

//Drawing the actual image
boolean CImageObject::ImageDraw()
{
int32 nRead;
uint32 dwCount;
ISourceUtil *m_pSourceUtil;
IAStream ** ppias;
void *buffer;

WebRespInfo* info = IWEBRESP_GetInfo(m_pIWebResp);
DBGPRINTF("ImageDraw Starting....");

ISHELL_CreateInstance(m_pIShell, AEECLSID_ASTREAM, (void**)&ppias);
ISHELL_CreateInstance(m_pIShell, AEECLSID_SOURCEUTIL, (void**)&m_pSourceUtil);

ISOURCEUTIL_AStreamFromSource(m_pSourceUtil,info->pisMessage,(IAStream*)&ppias);
if((IAStream*)0 != *ppias)
{
//read the image
nRead = IASTREAM_Read((IAStream*)&ppias, &buffer, dwCount);
//Set the image to the stream
IIMAGE_SetStream(m_pIImage, (IAStream *)&ppias);

//Calling Callback function when stream is decoded
IIMAGE_Notify(m_pIImage, (PFNIMAGEINFO)NotifyImage, this);
}

ISOURCEUTIL_Release(m_pSourceUtil);
IASTREAM_Release(*ppias);
m_pMenuCtl->Redraw();

return TRUE;

void CImageObject::NotifyImage(void *p, IImage *pIImage, AEEImageInfo *pi, int nErr)
{
((CImageObject*)p)->OnNotifyImage(pi);

void CImageObject::OnNotifyImage(AEEImageInfo* pi)
{
//IImage * m_pIImage = (IImage *)pias;
IIMAGE_Draw(m_pIImage,0,0);
IDISPLAY_Update(m_pIDisplay);

The Errors are in "ImageDraw()" function which is colored as "Red"

1. c:\SVNDev\voddemo\ImageObject.cpp(66): error C2664: 'int32 (ISourceUtil *,ISource *,IAStream ** )' : cannot convert parameter 2 from 'ISourceUtil *' to 'ISource *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

2. c:\SVNDev\voddemo\ImageObject.cpp(66): error C2664: 'int32 (ISourceUtil *,ISource *,IAStream ** )' : cannot convert parameter 3 from 'IAStream *' to 'IAStream ** '

PLZ...Help me!

Thanks in advance:)

I have solved that particular error. But still getting blank screen...No error at all. Can anybody plesae help me. It is urgent. I am attaching the refreshed code here:
//Drawing the actual image
boolean CImageObject::ImageDraw()
{
int32 nRead;
uint32 dwCount;
ISourceUtil *m_pSourceUtil;
IAStream ** ppias;
void *buffer;
dwCount = 0;
ISHELL_CreateInstance(m_pIShell, AEECLSID_ASTREAM, (void**)&ppias);
ISHELL_CreateInstance(m_pIShell, AEECLSID_SOURCEUTIL, (void**)&m_pSourceUtil);
WebRespInfo* info = IWEBRESP_GetInfo(m_pIWebResp);
if(info->nCode == 200 )
{
DBGPRINTF ("ncode->web status 2: %d", info->nCode);
ISource *pSource = info->pisMessage; //getting the image source
DBGPRINTF("image source: %s", pSource);
ISOURCEUTIL_AStreamFromSource(m_pSourceUtil,pSource,(IAStream**)&ppias);
DBGPRINTF("image :
}
DBGPRINTF("ImageDraw Starting....");
if((IAStream*)0 != *ppias)
{
//read the image
nRead = IASTREAM_Read((IAStream*)&ppias, &buffer, dwCount);
//Set the image to the stream
IIMAGE_SetStream(m_pIImage, (IAStream *)&ppias);
//Calling Callback function when stream is decoded
IIMAGE_Notify(m_pIImage, (PFNIMAGEINFO)NotifyImage, this);
}
ISOURCEUTIL_Release(m_pSourceUtil);
IASTREAM_Release(*ppias);
m_pMenuCtl->Redraw();
return TRUE;

void CImageObject::NotifyImage(void *p, IImage *pIImage, AEEImageInfo *pi, int nErr)
{
((CImageObject*)p)->OnNotifyImage(pi);

void CImageObject::OnNotifyImage(AEEImageInfo* pi)
{
//IImage * m_pIImage = (IImage *)pias;
IIMAGE_Draw(m_pIImage,0,0);
IDISPLAY_Update(m_pIDisplay);

Thank u so much.

I have solved that particular error. But still getting blank screen...No error at all. Can anybody plesae help me. It is urgent. I am attaching the refreshed code here:
//Drawing the actual image
boolean CImageObject::ImageDraw()
{
int32 nRead;
uint32 dwCount;
ISourceUtil *m_pSourceUtil;
IAStream ** ppias;
void *buffer;
dwCount = 0;
ISHELL_CreateInstance(m_pIShell, AEECLSID_ASTREAM, (void**)&ppias);
ISHELL_CreateInstance(m_pIShell, AEECLSID_SOURCEUTIL, (void**)&m_pSourceUtil);
WebRespInfo* info = IWEBRESP_GetInfo(m_pIWebResp);
if(info->nCode == 200 )
{
DBGPRINTF ("ncode->web status 2: %d", info->nCode);
ISource *pSource = info->pisMessage; //getting the image source
DBGPRINTF("image source: %s", pSource);
ISOURCEUTIL_AStreamFromSource(m_pSourceUtil,pSource,(IAStream**)&ppias);
DBGPRINTF("image :
}
DBGPRINTF("ImageDraw Starting....");
if((IAStream*)0 != *ppias)
{
//read the image
nRead = IASTREAM_Read((IAStream*)&ppias, &buffer, dwCount);
//Set the image to the stream
IIMAGE_SetStream(m_pIImage, (IAStream *)&ppias);
//Calling Callback function when stream is decoded
IIMAGE_Notify(m_pIImage, (PFNIMAGEINFO)NotifyImage, this);
}
ISOURCEUTIL_Release(m_pSourceUtil);
IASTREAM_Release(*ppias);
m_pMenuCtl->Redraw();
return TRUE;

void CImageObject::NotifyImage(void *p, IImage *pIImage, AEEImageInfo *pi, int nErr)
{
((CImageObject*)p)->OnNotifyImage(pi);

void CImageObject::OnNotifyImage(AEEImageInfo* pi)
{
//IImage * m_pIImage = (IImage *)pias;
IIMAGE_Draw(m_pIImage,0,0);
IDISPLAY_Update(m_pIDisplay);

Thank u so much.

Are you sure the phone supports jpegs natively?

Are you sure the phone supports jpegs natively?

jmiller2 wrote:Are you sure the phone supports jpegs natively?
Yes. JPEG is supported in VX6000 and in Motorola V710(so far I know). Could u please check the code and advise me what to do? I am kind of at a loss now. I have put all the necessary debugging statements and it is showing that the image is there. But I cannot see it in the emulator nor in the handset (I am testing it in LG8000 handset) and in V710 in emulator.
Pls help :(
Thanks.

jmiller2 wrote:Are you sure the phone supports jpegs natively?
Yes. JPEG is supported in VX6000 and in Motorola V710(so far I know). Could u please check the code and advise me what to do? I am kind of at a loss now. I have put all the necessary debugging statements and it is showing that the image is there. But I cannot see it in the emulator nor in the handset (I am testing it in LG8000 handset) and in V710 in emulator.
Pls help :(
Thanks.

Why don't you just convert it to .png ??? The last time i run into several problem because of the compression type, i changed everything to .png, everything had run smoothly since :)

Why don't you just convert it to .png ??? The last time i run into several problem because of the compression type, i changed everything to .png, everything had run smoothly since :)

orangbogor wrote:Why don't you just convert it to .png ??? The last time i run into several problem because of the compression type, i changed everything to .png, everything had run smoothly since :)
Thanks for all your replies. I had to do that for JPEG for the time being. Anyway, I have solved that problem. Seems that I was declaring the IAStream object locally. It needs to be declared in the header file and it has to be a pointer [I was declaring it as pointer to pointer before). So the thing is the data was receiving correcly but it was lost in the way. Now my problem is solved and WHEW...what a relief :D .
I just Love the BREW forum ;)

orangbogor wrote:Why don't you just convert it to .png ??? The last time i run into several problem because of the compression type, i changed everything to .png, everything had run smoothly since :)
Thanks for all your replies. I had to do that for JPEG for the time being. Anyway, I have solved that problem. Seems that I was declaring the IAStream object locally. It needs to be declared in the header file and it has to be a pointer [I was declaring it as pointer to pointer before). So the thing is the data was receiving correcly but it was lost in the way. Now my problem is solved and WHEW...what a relief :D .
I just Love the BREW forum ;)