Hi guys,
I saw some topics about "splash screens" but I didn't really get a answer to
my question.
I'm loading 2 pictures. I'd like to display the first pic for abour 3 sec
using "sleep". After that 3 sec the 2. pic should be loaded. I'm using only
one container.
So how can I implement that? I could swear that taht's very easy, but I
didn't find a working way.
Thx.
ZeroCool
do something like this:
1.load first picture
2.set drawing function to copy this picture to screen
3.call screen redraw so you get your pic on screen (at later times system might call this function)
4.save current time (you can save tick count for example using theuser::tickcount() or so)
5.load second image (yes, do it now, it takes a while to load)
6.initialize a timer to wait 3secs (or what's left from 3secs after loading picture), eventually you can set periodic timer to for ex 0.1sec and everytime it calls your function check user::tickcount()
7.if it's time to draw second image simple change your pointer from first image to second image and free the space in mem taken by first image
8.call screen redraw
9.your pretty much done, don't forget to free up mem resources for the second bitmap when you stop drawing it
for more info regarding loading bitmaps, drawing stuff to screen etc look into series60 sdk. There's an example that animates few ball pictures on screen...
I want to use sleep, cause my menu should be disabled!!!
Any idea to solve that?
if you build a full screen bitmap and bitblt it it will overdraw menu. (but hide menu just for sure earlier so you don't get some annoying flickering or so)
Are you sure??? I had a pic with a size of 176X208 (Fullscreen). My menu was not visible anymore (the pic overdrew it), but it was still working when I hit the selection keys.
And there are more things that are not really clear, hope you can help me.
* I load my pic in ConstructL().
* I bitblt it in Draw();
Then where do I have to put the timer?
Where must i bitblt the second pic that overdraws the first?
Thx. Sorry for those stupid questions... *g*
C'Ya
if you create a periodic timer you put it in construct.
periodic timer will call your special function every x ns. all you have to do is to check if 3secs have passed and start bitblitting the other bitmap.
about menu.. try this:
iEikonEnv->AppUiFactory()->StatusPane()->MakeVisible(EFalse);
iEikonEnv->AppUiFactory()->StopDisplayingMenuBar();
(or sth similar, got it out of the top of my head - look in sdk for appuifactory and what access you get when you use it, it should help)
i don't use menu so it's difficult for me to tell you much about it.
(another way might be to take over keyboard control and always return ekeywasconsumed to tell symbian that you have used this key, it shouldn't go to menu then, althrought i'm not 100% sure.)
hope it helps
I tried this before, but...
When I start my app a white screen appears. (white screen, because no pic was loaded!) and after 3 sec. my splash screen appears.
When do I have to close the timer...if I start my timer in ContructL()...
Ok, let's do in Pseudo Code:
CostructL()
{
Pic LoadPic1=test1.mbm;
Pic LoadPic2=test2.mbm;
StartTimer:
// what to do in here?
StopTimer;
}
And of course I bitblt it in Draw() the actual pic using flags.
C'Ya
The right way to do this is probably to be asynchronous. That is, do something like this pseudocode:
[code:1]
CYourAppView::ConstructL() {
DisableMenus();
LoadSplashScreen();
iTimer = CPeriodic::NewL(EPriorityStandard);
iTimer->Start(KThreeSeconds, KNotImportant, StopDisplayingSplashScreen);
DrawNow();
}
CYourAppView::StopDisplayingSplashScreen() {
LoadNormalImage();
EnableMenus();
DrawNow();
}
[/code:1]
Hope this helps.
stop your timer after 6secs and stop bitblting image so you can have normal program usage?😊 Read SDK, it's all there..
in the function that your periodictimer is calling you can do it
(solution presented in post above me is perfectly valid)
WOW, that'S how I wanted it to see!!! THX!!!!!
I'll try it when I'm at home. But now I guess the problem is solved.
A big thx to both of you!!!
C'Ya