PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Capture Today screen before app starts.

Slither2006 · 09 Jan 2008, 11:04 UTC
Hi I'm new to Edge and c++ but have grasped the main concepts for my needs. I'm very happy with the speed and performance also it's really a marvel!

One thing I wish to do is apply a fade in transition when my program starts on my Windows Mobile 2003 and WM05 device.

I would like to do it this way. Capture the today screen and then use that as the background surface while I blend my program animation surface over the top until the Today screen surface has completely blended and all you can see is my animation surface.

Any help would be great thanks!
Slither2006 · 10 Jan 2008, 05:43 UTC
Ok it looks like the reply may take a while.

But for those of you who know other things. Can you please help me with this instead?

I'd like to copy a small portion of an E2DSurface to a smaller E2DSurface.


Anybody?

I'm thinking about purchasing the Full license of Edgelib but the forums seem a bit quite :( (having second thoughts now)
Hi,

You can use the EFL_SCREENCAPTURE flag of the EDGELIB configuration (in the OnFrameworkConfig callback) to copy the screen contents in the backbuffer when your application starts.

Then you can make your own wipe between the picture in the backbuffer and the screen image of your application.
Slither2006 · 10 Jan 2008, 11:00 UTC
Thanks for your reply!

This sounds very promising. I'll see if I can do it and post back with results.

Thanks again!! :D
Slither2006 · 10 Jan 2008, 11:10 UTC — Ini Files question
One question I forgot to ask. I would like to test out the ini reading/writing file access of the evaluation. So far I can only read and create binary files. Is there a special way to access and create ini files please?


[Edit:] Never mind I found the EClassIni in the reference guide. I really like the reference guide that was made. Good job!

[2nd Edit:] Any idea why my application crashes...I'm assuming because it has issues either opening the ini file or reading from it. I use an &tmp; char variable to point to the key to as I only need the values.

Here's my function to open and read the ini file :

Code:
void ClassMain::LoadCfg(void)
{
ClassEIni ei;
if (ei.Open("programlist.ini", EFOF_READ))
{
char tmp;
ei.ReadLine(&tmp;,&prgLst;.cMusicApp1Dir);
ei.ReadLine(&tmp;,&prgLst;.cMusicApp1File);

ei.Close();
}
}


[3rd Edit:] :oops: worked fine when I placed NULL in the key fields instead...lolol
Hi,

I'm affraid passing NULL to Readline won't work and will leave your variables empty (or undefined). Create a temporary string instead of a single character, for example:

Code:

void ClassMain::LoadCfg(void)
{
ClassEIni ei;
if (ei.Open("programlist.ini", EFOF_READ))
{
char tmp[MAX_ESTR];
ei.ReadLine(tmp, &prgLst;.cMusicApp1Dir);
ei.ReadLine(tmp, &prgLst;.cMusicApp1File);

ei.Close();
}
}


I think you also need to change your prgLst structure and make them strings (like I did in the above sample with tmp).
Slither2006 · 11 Jan 2008, 05:28 UTC
Excellent! Thanks for the advice! I'll get it fixed up as soon as I get home.


I may need a code sample for the screen caputre functionality but will first try my best before bugging you guys.

Regards,

Slither2006.
Slither2006 · 14 Jan 2008, 00:36 UTC — More assistance with blend wipes needed
Okay I know I'm missing some basic concept of working with buffers and surfaces.

Here's how far I've gotten.

Over the duration of 5 frames I have an long value called "lDissolve" which holds the time in milliseconds for the wipe effect. It starts at 0 and increments 5 times evenly to 65535.

Here is the wipe that I call :

display->Wipe(&esBlended;, &display-;>buffer,&esAnimBG;,lDissolve,EWIPE_BLEND,NULL,0);

I created the empty destination surface as "esBlended" note that this surface has only been declared in the member variables and nothing more has been done to it.

My first source surface "esAnimBG" is a set to hold a png image and is done so during the OnDisplayInit() function. Please note during the blend a RECT structure is set to 5 different locations of the esAnimBG surface to provide an opening animation effect.

My second source surface is the buffer which contains the captured screen before the program runs...so in this case it would be a screen capture of the today screen. I have created filled the buffer with this image data by adding the above mentioned flag "EFL_SCREENCAPTURE".

Now I can't seem to get the blend effect between the two source surfaces perfectly. I have managed to get a halfway decent blend but it looks terrible as it shows all 5 frames blended together including the today screencapture from the buffer.

Please can someone point me in the right direction?

Thanks in advance! :)

[Edit:] Try number 2:

Ok I've tried this approach as well but am still not seeing a blend effect only the normal animation. Here's what I did :

Code:
myDisplay.buffer.BltFast(0,0,&esAnimBG;,&rArea;);
display->Wipe(&esBlended;, &display-;>buffer,&myDisplay;.buffer,lDissolve,EWIPE_BLEND,NULL,0);
SetNextFrame(display);
display->BltFast(0,0,&esBlended;,&rBlendRect;);


I thought the above would work but it doesn't...What I tried to do in the above code was. First Blit the animation frame to a ClassEDisplay object I instasiated as a member variable. Then I performed the wipe using the buffer from the display object and the one I created that holds the animation frame. I then Blit the resulting surface and it only shows the animation frame with no blending???? Am I on the right track please?


[Solution!!!]

Ok so it took me a few hours of tinkering but basically you must initialize ALL surfaces you wish to use. you can do this either by populating image data from a file into the assigned memory of the surface or you can just state the size and set it to EST_DEFAULT. Then you can just BLTFAST function the actual surface and either a display->buffer or another actual surface. For the Blend effect I just made used an incremental EFX_OPACITY which gave an even better effect. I LOVE THIS LIBRARY!!!

Another Question maybe easier to answer...How do I capture what's in the display memory (ie Today Screen) before the application resumes from a onRestore() call??

Thanks in Advance.
Hi,

You can use the BackFlip function which is part of ClassEDisplay. This will copy the current display back into the backbuffer.
Slither2006 · 14 Jan 2008, 23:06 UTC
Hi Edge,

Thanks for your reply.

I've tried placing the below listed code in both the OnDisplayInit() function and the OnNextFrame() function. Neither seem to copy the today screen to the display buffer before my program starts its animation.

Code:
display->BackFlip();
esBlendBGCpy.BltFast(0,0,&display-;>buffer,&rArea;);


Where and when is the best place to perform the display->BackFlip() please?

I also tried another approach.

I added a call to the below function as soon as OnRestore() is called. I instansiated a ClassEDisplay Object as a member variable declared as 'myDisplay'.

Code:
void ClassMain::BackFlip2Buffer(void)
{
RECT rFlipRect;
SetRect(&rFlipRect;,0,0,240,320);
myDisplay.BackFlip();
esBlendBGCpy.BltFast(0,0,&myDisplay;.buffer,&rFlipRect;);
}


I also placed the call to the BackFlip2Buffer function in my OnMinimize() function instead of OnRestore(). Neither appear to work...any ideas please?

[Solution!!!]

Okay this didn't take too long. I got rid of my backflip2buffer function and just performed the following code before anything had been blittled to the screen.
Code:

display->BackFlip();
esBlendBGCpy.BltFast(0,0,&display-;>buffer,&rBlendRect;);


This code was placed in the OnNextFrame() function and as I said was the first Blit action to be performed. If I had placed this after some other screen / blit action it would have captured that into the buffer.

I'm very happy with the result. The fade in and fade out transition is seemless no matter which window is open in the background when my program either starts or restores.
yucani · 08 Feb 2009, 15:19 UTC — UIQ
Hi,

is this correct, that on UIQ2 and UIQ3 this method to capture the display memory (of the system) does not work?
Hi Yucani,

You're correct, this feature is only supported on Windows Mobile.