To display .jpg image on the device
Login to reply to this topic.
Fri, 2009-01-23 05:04
Joined: 2009-01-12
Forum posts: 4

Hi All,

I'm trying to develop a file browser application which has to open the image files. On part of it now I'm trying to convert .jpg to bitmap.

I used CImageDecoder, CFbsBitmap and ActiveObject for conversion.

When I debug my code on the device, it shows (Suspended: Signal 'Exception 0' received. Description: A data abort exception has occured) on the line SetActive() which I called after iBitmap->Create(...);

Could anyone please help me, how to get out of this exception.

Thanks in advance.

Regards,
SA


Fri, 2009-01-23 09:49
Joined: 2003-01-14
Forum posts: 2133

May be you should post a little bit more of your code!


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2009-01-23 10:15
Joined: 2009-01-12
Forum posts: 4

Hi Eric,

I have a function called BeginDecodeL() in a Class which is derived from CActive. The code is as follows,

CImageDecoder* iImageDecoder;
CFbsBitmap* iBitmap;

CHelloActive* CHelloActive::NewL()
{
CHelloActive* self = new(ELeave) CHelloActive();
CleanupStack::PushL( self );

self->ConstructL();

CleanupStack::Pop(self);
return self;
}

CHelloActive::CHelloActive()
:CActive(EPriorityStandard)
{
}

void CHelloActive::ConstructL()
{
User::LeaveIfError(iFs.Connect());
CActiveScheduler::Add(this);
}

CHelloActive::~CHelloActive()
{
Cancel();
delete iImageDecoder;
iFs.Close();
delete iBitmap;
}

void CHelloActive::BeginDecodeL()
{
TInt err1,err,FrameCount;

TBuf8<50>MimeType(0);

_LIT(iFilename, "E:\\Images\\Saki.jpg");

CImageDecoder::GetMimeTypeFileL(iFs,iFilename,MimeType);

TRAP(err,iImageDecoder = CImageDecoder::FileNewL(iFs,iFilename,MimeType));
if (err != KErrNone)
{
iFs.Close();
}
FrameCount = iImageDecoder->FrameCount();
const TFrameInfo FrameInfo = iImageDecoder->FrameInfo(FrameCount-1);
iBitmap = new (ELeave) CFbsBitmap();

TRAP(err1,iBitmap->Create(FrameInfo.iOverallSizeInPixels,FrameInfo.iFrameDisplayMode));

TRAP(err,iImageDecoder->Convert(&iStatus,*iBitmap,FrameCount-1));

SetActive();

if (err != KErrNone)
{
TInt flag = 1; // For debug purpose
}

}

void CHelloActive::RunL()
{
if (iStatus.Int() == KErrNone)
{
TInt DecodeFlag =1;
}
}

void CHelloActive::DoCancel()
{
iImageDecoder->Cancel();
}

When it reaches SetActive() line, I get the exception as mentioned in my previous post.

Help me...

Thanks & Regards,
SA

Sat, 2009-01-24 03:23
Joined: 2009-01-12
Forum posts: 4

Anybody help me, how to clear the above mentioned exception.

Thanks
-SA


copyright 2003-2009 NewLC SARL