×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    87

    view based app backgound - how to set standart theme background image ?

    hi,
    I know some apps which use mmmmm.... theme image as it's own background
    theme image - I mean an image when all apps are closed - main menu image

    I wonder how can I do that?

    I know I can do somthing like this:

    CCoeEnv::Static()->ScreenDevice()->CopyScreenToBitmap(m_pBackground, r);

    but in this case my background depends on any other shown apps;

    so how to get theme main background ???

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: view based app backgound - how to set standart theme background image ?

    Hi,

    such application use skins. On S60 platform there is API (which is strange and horrible!!!) which allow you to use the skin, which was set by user as a backgorund of your application - it could also affect other controls appearance... I could cut&paste a piece of code if you need from one of our skinned app...

    Bye
    STeN

  3. #3
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    87

    Re: view based app backgound - how to set standart theme background image ?

    hi,

    >I could cut&paste a piece of code if you need from one of our skinned app...

    pls, show it...
    I tryed CAknDrawUtils::Background(...) - with no result...

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: view based app backgound - how to set standart theme background image ?

    Hi,

    I customized a container in a dialog to be skinned for example. In header file I add one method and one member:
    --------------------------------
    TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
    CAknsBasicBackgroundControlContext* iBgContext;

    and forward declaration:
    -----------------------
    class MAknsControlContext;
    class CAknsBasicBackgroundControlContext;

    In code I made this changes:
    ---------------------------
    #include <AknsDrawUtils.h>// skin
    #include <AknsBasicBackgroundControlContext.h> //skin

    ConstructL():
    -------------
    iBgContext = CAknsBasicBackgroundControlContext::NewL(
    KAknsIIDSkinBmpMainPaneUsual, TRect(0,0,1,1), ETrue);

    Draw() was modified:
    --------------------
    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
    MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );

    if( AknsDrawUtils::HasBitmapBackground( skin, cc ) )
    {
    AknsDrawUtils::Background( skin, cc, this, iCoeEnv->SystemGc(), aRect );
    }

    instead of "standard" filling code:
    -------------------------------
    gc.SetBrushColor( KRgbWhite );
    gc.SetPenStyle( CWindowGc::ENullPen );
    gc.SetBrushStyle( CWindowGc::ESolidBrush );
    TRect rect = aRect;
    rect.iTl = TPoint( 0, 0 );
    gc.DrawRect( rect );

    SizeChanged():
    --------------
    if ( iBgContext )
    {
    iBgContext->SetRect( Rect() );

    if ( &Window() )
    {
    iBgContext->SetParentPos( PositionRelativeToScreen() );
    }
    }

    MopSupplyObject:
    -----------------
    TTypeUid::Ptr CPCContainer::MopSupplyObject(TTypeUid aId)
    {
    if (iBgContext)
    {
    return MAknsControlContext::SupplyMopObject(aId, iBgContext );
    }
    return CCoeControl::MopSupplyObject(aId);

    }

    But make app skinned is not always the same you must try&test...

    Bye
    STeN

  5. #5
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    87

    Re: view based app backgound - how to set standart theme background image ?

    it works!

    thanks

  6. #6
    Regular Contributor
    Join Date
    Jan 2004
    Posts
    128

    Question Re: view based app backgound - how to set standart theme background image ?

    I have two rich editors in my view. I also would like to highlight one of the rich text editors. I was thinking about creating the following at the constructor of the container:

    m_pBackground = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain, rect, EFalse);

    m_pHighLight = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMainHigh, rect, EFalse );


    However, I don't know what I should return from the TTypeUid::Ptr MopSupplyObject(TTypeUid aId) method. Any idea?

    Regards,

    Ferran

  7. #7
    Regular Contributor
    Join Date
    Jun 2007
    Posts
    52

    Question Re: view based app backgound - how to set standart theme background image ?

    Hi Stenlik,
    Im also Used the posted Code by u ,it's Working Fine, But it's not taking the image which i want to display.......
    I need to Display an image as Back ground for my application....
    Waiting for Your Reply..
    Thanks in Advance.........

Similar Threads

  1. Set the app to run in background from code
    By symsym in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-10-29, 17:40
  2. How can i set mobil image background?
    By cminh in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-11-24, 03:46
  3. Setting a background image on CAknGrid
    By aljaz24 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-01-30, 08:40
  4. background image in series60
    By jack44 in forum Symbian
    Replies: 1
    Last Post: 2003-07-31, 18:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×