WSERV 10 Panic with bitmap loading
| Fri, 2003-10-24 08:02 | |
|
I'm having a problem where I get a WSERV 10 Panic error when I run my code on the phone (7650), the code works fine on the emulator.
I've figured out that the problem occurs when I'm loading bitmaps using the following: _LIT(KMBMFileName,"Z:\\System\\apps\\lookup\\splash_icon.mbm"); // load the bitmap from an .mbm file ibitmap = new (ELeave) CFbsBitmap(); ibitmapMask = new (ELeave) CFbsBitmap(); User::LeaveIfError(ibitmap->Load(KMBMFileName, EMbmSplash_iconSplash_image)); User::LeaveIfError(ibitmapMask->Load(KMBMFileName, EMbmSplash_iconSplash_image_mask)); This code was working, until I added another compound control. Does anyone have any idea what's going on? Thanks. |
|






Forum posts: 363
You should activate the drawing context only once per each drawing iteration - it appears that you are doing it twice.
Cheers,
Pawel
Forum posts: 106
Regards,
Varun
Forum posts: 38
void LoadBitmapL(CFbsBitmap* aBitMap,const TDesC& aPathAndFile,TInt aId/*,TBool aShareIfLoaded*/)
{
_LIT(KTxtCDrive,"C:");
_LIT(KTxtZDrive,"Z:");
TParse mbfn;
mbfn.Set(aPathAndFile,&KTxtCDrive,NULL);
if (!aBitMap->Load(mbfn.FullName(),aId,ETrue))//ETrue --> aShareIfLoaded
return;
mbfn.Set(aPathAndFile,&KTxtZDrive,NULL);
User::LeaveIfError(aBitMap->Load(mbfn.FullName(),aId,ETrue));//ETrue --> aShareIfLoaded
return;
}
i found it in one of the uiq exemple.
The loading works well BUT, now i'v got a WSERV 7 panics code.
I load my bitmap in :
void CMyView::ConstructControlsL()
{
monImage = new (ELeave) CFbsBitmap();
LoadBitmapL(monImage,KMBMFileName,EMbmIdimgbrassieFondgolf);
}
and i want to draw it in the Draw() function:
void CMyView::Draw(const TRect&/* aRect*/) const
{
CWindowGc& gc = SystemGc();
gc.Clear();
gc.BitBlt(TPoint(0,0), iImgFdVueInfosGolf);
}
I can't? what did i do wrong? or how can i draw my bitmap?
Thx a lot.
-----------------------------------------------------------
BnJ, Developpeur Beta 2