×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: Splash Screen

  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Splash Screen

    er, what does this line of code mean??

    _LIT(KtxMySplashImage ,"\\private\\<My SID>\\splash.mbm" );

    and if i have a image, where should i place it so my program can call it??
    please help.. thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Splash Screen

    that means that the splash.mbm is supposedly located in your application's private directory, and you should replace the <My SID> with your own private folder's name.

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Re: Splash Screen

    what do u mean by my own private folder? do u mean i can create a folder (ex. Picture folder) in my application(splashscreen) folder?

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Splash Screen

    You should propably read the basics of teh platform security for Symbian OS, the private directoty thing is on of the basics on it, and you can not really do any real programs on Symbian 3rd edition forward without understanding the platform security bsics.

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Re: Splash Screen

    do u mind giving me some link?? thanks

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Splash Screen

    Google would be your best fried on finding information, also we do have search box here, as well as in wiki, so you could do a bit of searching by yourself as well.

    Anyway, to get you started here's one link to our wiki: http://wiki.forum.nokia.com/index.ph...Security_Model

  7. #7
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Re: Splash Screen

    _LIT(KtxMySplashImage ,"\\private\\0xEDB0995D\\splash.mbm" );
    i know what is my priavte directory... but the splash.mbm i mus put in right?? how do i put in??

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: Splash Screen

    Apparently you do not... That 0x would ruin everything.
    Otherwise on the device you install the files to your private directory, just as anywhere else.
    In the emulator, you can specify "TARGETPATH \\private\\EDB0995D" after "START BITMAP splash.mbm".

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Splash Screen

    yep, and as can be seen from the wiki example: http://wiki.forum.nokia.com/index.ph...implementation, you would need to do the mbm with bmconv and have the splash image put there as a first bitmap of the mbm.

  10. #10
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Re: Splash Screen

    er, currently i am using the code of this website http://wiki.forum.nokia.com/index.ph...lashScreen.zip

    i wanted to do a splashscreen like it appear before everything then it will go to the main page...
    but when i start, my program will just close?? why does this happen? is it memory leak?? how to solve it?

  11. #11
    Regular Contributor
    Join Date
    Apr 2008
    Location
    India
    Posts
    477

    Re: Splash Screen

    Quote Originally Posted by 074394Q View Post
    er, currently i am using the code of this website http://wiki.forum.nokia.com/index.ph...lashScreen.zip

    i wanted to do a splashscreen like it appear before everything then it will go to the main page...
    but when i start, my program will just close?? why does this happen? is it memory leak?? how to solve it?
    does your application opens?
    if yes.

    what is the panic code you are getting... and try to debug the code to get the exact line whr its panicing.

  12. #12
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Re: Splash Screen

    i run debug and have this errors~

    high: canpanic: leaving function called in non-leaving function
    high: canpanic: destructor is accessing/dereferencing data member
    high: canpanic: ignoring Open() return value

    how to solve them?? this errors are in my SplashScreen.h and cpp and ActiveObject.cpp

    SplashScreen.h

    #include <W32STD.H>
    #include <FBS.H>

    class CFbsBitmap;

    class CSplashScreen
    {
    public:

    CSplashScreen(RArray<TInt>* aBitmapHandle);
    ~CSplashScreen();
    void Show();
    void Refresh();
    void StopSplashRefresh();
    private:
    RWsSession iWs;
    RWindowGroup iWg;
    CWindowGc* iGc;
    RWindow iWindow;
    CWsScreenDevice* iScreenDevice;
    RArray<TInt>* iBitmapHandle;
    };

    SplashScreen.cpp

    const TInt screenWidth = 360;
    const TInt screenHeight = 480;

    /*
    * CSplashScreen::CSplashScreen(RArray<TInt>* aBitmapHandle)
    * The aBitmapHandle contains handles to the icon and the mask
    */
    CSplashScreen::CSplashScreen(RArray<TInt>* aBitmapHandle)
    {

    User::LeaveIfError(iWs.Connect());
    iScreenDevice = new(ELeave) CWsScreenDevice(iWs);
    iScreenDevice->Construct();
    TPixelsTwipsAndRotation curPixTwipsRot;
    iScreenDevice->GetDefaultScreenSizeAndRotation(curPixTwipsRot);
    TRect screenRect = curPixTwipsRot.iPixelSize;

    iWg = iWs;
    User::LeaveIfError(iWg.Construct(reinterpret_cast<TUint32>(&iWg), EFalse));
    iWg.SetOrdinalPosition(10, ECoeWinPriorityAlwaysAtFront);

    User::LeaveIfError(iScreenDevice->CreateContext(iGc));

    iWindow = iWs;
    User::LeaveIfError(iWindow.Construct(iWg, reinterpret_cast<TUint32>(&iWg) + 1));
    iWindow.SetBackgroundColor(TRgb(0xff, 0xfa, 0xfa));
    iWindow.Activate();
    iWindow.SetExtent(TPoint(0, 0), TSize(screenRect.Width(), screenRect.Height()));
    iWindow.SetVisible(ETrue);

    iBitmapHandle = aBitmapHandle;
    }

    CSplashScreen::~CSplashScreen()
    {
    iWindow.Close();
    iWg.Close();

    if(iGc)
    {
    delete iGc;
    iGc = NULL;
    }

    if(iScreenDevice)
    {
    delete iScreenDevice;
    iScreenDevice = NULL;
    }
    iWs.Close();
    iBitmapHandle->Reset();
    }


    /*
    * void CSplashScreen::Show()
    * Function that begins the redraw and needs to be called only once to avoid flickering
    */
    void CSplashScreen::Show()
    {
    iGc->Activate(iWindow);
    TRect rect = TRect(iWindow.Size());
    iWindow.Invalidate(rect);
    iWindow.BeginRedraw(rect);

    iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
    iGc->Clear();
    Refresh();
    }

    /**
    * Function to refresh the view repeatedly so that the welcome screen holds for sometime
    */
    void CSplashScreen::Refresh()
    {
    TRect rect = TRect(iWindow.Size());
    //create the bitmap for this thread using the handle passed. No need to clean up as it creates only a pointer to the existing icon
    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
    bitmap->Duplicate((*iBitmapHandle)[0]);
    //create the bitmap mask for this thread using the handle passed. No need to clean up as it creates only a pointer to the existing icon
    CFbsBitmap* bitmap_mask = new (ELeave) CFbsBitmap();
    bitmap_mask->Duplicate((*iBitmapHandle)[1]);
    //Draw the icon from the center of the screen
    iGc->BitBltMasked(TPoint(0, 0), bitmap, rect, bitmap_mask, ETrue);
    iGc->DrawRect(TRect(TPoint(50,100), TSize(40,40)));
    StopSplashRefresh();
    }

    /**
    * Called to end the redraw and flush the Window Server
    */
    void CSplashScreen::StopSplashRefresh()
    {
    iWindow.EndRedraw();
    iGc->Deactivate();
    iWs.Flush();
    }

    ActiveObject.cpp

    CActiveObject* CActiveObject::NewL(MWaitObserver& aMyObserver, RArray<TInt>* aBitmapHandle)
    {
    CActiveObject* self=new (ELeave) CActiveObject(aMyObserver);
    self->ConstructL(aBitmapHandle);
    return self;
    }

    void CActiveObject::ConstructL(RArray<TInt>* aBitmapHandle)
    {
    iSplashScreen = new(ELeave) CSplashScreen(aBitmapHandle);
    }

    CActiveObject::CActiveObject(MWaitObserver& aMyObserver)
    :CActive(CActive::EPriorityStandard),
    iMyObserver(aMyObserver)

    {
    CActiveScheduler::Add(this);
    iThisThread.Open(RThread().Id());
    actThread.Create(_L("SplashThread"),CActiveObject::MyThread, KDefaultStackSize, NULL,this);
    }

    CActiveObject::~CActiveObject()
    {
    actThread.Terminate(KErrNone);
    Cancel();

    if(iSplashScreen)
    {
    delete iSplashScreen;
    iSplashScreen = NULL;
    }
    }


    void CActiveObject::ThreadSuspend()
    {
    TRequestStatus* requestStatus = &(iStatus);
    iThisThread.RequestComplete(requestStatus, KErrGeneral);
    actThread.Suspend();
    }

    void CActiveObject:oCancel()
    {
    }


    void CActiveObject::IssueRequest(TInt aCounter)
    {
    iCounter = aCounter;
    iStatus = KRequestPending;
    SetActive();
    actThread.Resume();
    }


    void CActiveObject::RunL()
    {
    if(iStatus == KErrNone && iCounter < 10)
    {
    iSplashScreen->Show();
    iMyObserver.DoReDraw();
    }
    else if(iStatus == KErrGeneral)
    {

    }
    else
    {
    iMyObserver.ThreadNotify();
    }
    }

    TInt CActiveObject::MyThread(TAny* aPkg)
    {
    RThread thisThread;
    while(ETrue)
    {
    CActiveObject* active = static_cast<CActiveObject*>(aPkg);
    User::After(1*1000*1000);
    TRequestStatus* requestStatus = &(active->iStatus);
    (active->iThisThread).RequestComplete(requestStatus, KErrNone);
    thisThread.Suspend();
    }
    }

  13. #13
    Regular Contributor
    Join Date
    Apr 2008
    Location
    India
    Posts
    477

    Re: Splash Screen

    Quote Originally Posted by 074394Q View Post
    i run debug and have this errors~

    high: canpanic: leaving function called in non-leaving function
    high: canpanic: destructor is accessing/dereferencing data member
    high: canpanic: ignoring Open() return value

    how to solve them?? this errors are in my SplashScreen.h and cpp and ActiveObject.cpp
    These are not the Run or debug errors.

    these are the errors when you run the code scanner on your code.

    If you want to remove these errors then you must follow the symbian coding conventions.

    for ex.

    a simple one:

    CSplashScreen() is the constructor of the class which must not leave..

    And you are usign LeaveIfError() here.

  14. #14
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    136

    Re: Splash Screen

    o... ok... then how do i revert it back to normal??

  15. #15
    Regular Contributor
    Join Date
    Apr 2008
    Location
    India
    Posts
    477

    Re: Splash Screen

    Quote Originally Posted by 074394Q View Post
    o... ok... then how do i revert it back to normal??
    What does the normal mean?

    Just try to remove the errors.

Similar Threads

  1. Splash Screen Problem??
    By xahid2k in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-08-01, 17:56
  2. Splash Screen issue for S60 5th edition mobile
    By sreekanth288 in forum Mobile Java General
    Replies: 9
    Last Post: 2009-03-21, 11:34
  3. Regarding splash screen
    By a.hussain in forum Mobile Java General
    Replies: 1
    Last Post: 2008-06-12, 16:51
  4. how to show a splash screen, then a list?
    By lingtze1 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-08-13, 05:55
  5. splash screen doesnt show??? why?
    By lingtze1 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-06-10, 08:00

Posting Permissions

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