Read-only archive of the All About Symbian forum (2001–2013) · About this archive

problen with displaying Label in View......

0 replies · 1,593 views · Started 23 April 2005

I need to create a label and place bitmap in a view.
I am able to draw bitmap on top leftcorner but i am unable to dispaly the label.
Following is the code snippet.When i run this appln it will display bitmap but NO Label.....
What could be the problems??
Any pointers???

void CExampleAppView::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
_LIT(KMBMFileName,"C:\\system\\apps\\graphics\\bgscreen.mbm"😉;
ibitmap = new (ELeave) CFbsBitmap();
ibitmap->Load(KMBMFileName,EBitmap1,ETrue);
iLabelText = iEikonEnv->AllocReadResourceL(R_LABEL_TEXT);
iLabel = new (ELeave) CEikLabel;
ActivateL();
}

void CExampleAppView:😃raw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
TRect drawRect = Rect();
const CFont* fontUsed;
gc.Clear();
drawRect.Shrink(10,10);
fontUsed = iEikonEnv->TitleFont();
gc.UseFont(fontUsed);
// Draw bitmap

TPoint pos(-200,-75);
gc.BitBlt(pos,ibitmap);

TPoint pos1(20,20);
TPoint pos2(100,40);
TRect rect(pos1,pos2);
iLabel->SetRect(rect);
iLabel->SetTextL(*iLabelText);
iLabel->DrawNow();
gc.DiscardFont();

}

Thanks in advance.....