placing a background bitmap in UIQ 3

Login to reply to this topic.
Wed, 2005-10-05 16:00
Joined: 2005-10-05
Forum posts: 16
Ive been at this for a while now, Im looking to place a background bitmap on all my views.  Ive found no help in the docs, and seem to have working code, that just doesnt draw the bitmap when i switch to the views that i am trying to place a background on.  does anyone know of a example or link that will help me figure out what im doing wrong?  Thanks in advance.

Thu, 2005-10-06 08:10
Joined: 2003-12-05
Forum posts: 672
Re: placing a background bitmap in UIQ 3
Could you show us the code, so that we can comment what goes wrong?

In principle, just draw the bitmap in your view's Draw(), using CFbsBitmap and the graphics context.
Thu, 2005-10-06 20:18
Joined: 2005-10-05
Forum posts: 16
Re: placing a background bitmap in UIQ 3
**here is the code from the (view).cpp file
void CSMSGuardAboutView::ConstructL()
   {
   // Calls ConstructL that initialises the standard values.
   // This should always be called in the concrete view implementations.
   CQikViewBase::ConstructL();
   
   RWsSession aWSession;
   aWSession.Connect();
   CWsBitmap* aboutBitmap = new CWsBitmap(aWSession);
   aboutBitmap->Load(KMBMFileName, EMbmSmsguardAbout, ETrue);
   CQikWsBitmapBackground* abackgroundBitmap = CQikWsBitmapBackground::NewL(aboutBitmap,0);
                //something goes here, Draw()?, but im not sure how to use it, and what else i need other then the CWsBitmap
                //the docs had something with args that i havnt used before
                //virtual IMPORT_C void Draw(CWindowGc &aGc, const CCoeControl &aControl, const TRect &aRect) const;
   
   }

**here is the mbm resource code
START BITMAP   SMSGuardBitmaps.mbm
HEADER
TARGETPATH      \Resource\Apps
SOURCEPATH      ..\Images
SOURCE   c24      About.bmp
SOURCE  c24      Main.bmp
END

**here is the place I am activating the view (from the main view drop down menu)
case ESMSGuardInfoPrint6Cmd:
{
    //About view
    SaveThenDnlToL(TVwsViewId(KUidSMSGuardApp,KUidSMSGuardAboutView));
    break;
}   
Fri, 2005-10-07 08:37
Joined: 2003-12-05
Forum posts: 672
Re: placing a background bitmap in UIQ 3
You can load the bitmap in ConstructL, but you have to have it as a class member variable. Then, when the view is constructed, the system will initate redrawing, and the Draw you implement will be called. There, just get the graphics context and use it to draw your bitmap. Where ever in your code you want to initate redrawing yourself, just call view's DrawNow or DrawDeferred.
Fri, 2005-10-07 09:17
Joined: 2005-03-14
Forum posts: 91
Re: placing a background bitmap in UIQ 3
and don't forget that CWsBitmap::Load() returns an error code - so check the return to see if it is successful or not.

---
Kevin Dixon
Symsource Ltd.
www.symsource.com

Fri, 2005-10-07 15:35
Joined: 2005-10-05
Forum posts: 16
Re: placing a background bitmap in UIQ 3
thanks for the tips, ill see if i can get it to work like you suggest.
Thu, 2006-09-07 09:46
Joined: 2003-12-09
Forum posts: 2
Re: placing a background bitmap in UIQ 3
Yo, did u manage to sort this out, got the bitmaps to show up ?  Undecided
  • Login to reply to this topic.