PocketMatrix forums

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

How do I Stop EasyCE taking control of all the buttons ?

I've a 3rd party app that I wan't to use to get screen shots etc, this app requires me to hit a button to do it..... but since easyce takes control of them it does not register, is there a way of stopping easyce for one button etc....

-Brendan
Conan · 19 Apr 2002, 16:53 UTC — Easy CE & Screen shots
I thought there was an EasyCE function to make a screenshot? I assumed I would have to add my own function to PocketGL and was going to use the EasyCE one as a template so I must have seen code somewhere?
Had a quick look through the 1.6 code & beta 2 there's no screenshot code to see.

Also, if GAPI has taken over the whole screen how can a screen-shot program get at the data? It would be great if it could. I should contact the Developer-one people who write Screensnap which I have registered & see if they can update to work with GAPI.
maybe someone could write a func to write the contents of the current screen "buffer" to a bmp file, that can't be hard surly, or maybe someone already has ?

-Brendan
Try putting this:
Code:

#pragma pack(1)
struct tgaheader
{
BYTE byIdLength;
BYTE byColorMapType;
BYTE byImageType;
short nColorMapFirstIndex;
short nColorMapLength;
BYTE byColorMapEntrySize;
short nXOrigin;
short nYOrigin;
short nImageWidth;
short nImageHeight;
BYTE byPixelDepth;
BYTE byImageDescriptor;
};

struct TGA_FILE_FOOTER
{
long lExtensionAreaOffset;
long lDeveloperDirectoryOffset;
char cSignature[18];
};
#pragma pack()

void writetga( TCHAR* file, int w, int h, unsigned short* source )
{
DWORD size = w * 2 * h + 20, bytesread;
BYTE* tgabuff = new BYTE[size];
tgaheader head;
memset(&head;, 0, sizeof(head));
head.byImageType = 2;
head.nImageWidth = w;
head.nImageHeight = h;
head.byPixelDepth = 16;
memcpy(tgabuff, &head;, sizeof(head));
unsigned short* dst = (unsigned short*)tgabuff + 9 + (h - 1) * w;
unsigned short* src = (unsigned short*)source;
for ( int i = 0; i < h; i++ )
{
for ( int x = 0; x < w; x++ )
{
int red = (*(src + x) & (31 << 11)) >> 11;
int green = (*(src + x) & (31 << 6)) >> 6;
int blue = *(src + x) & 31;
*(dst + x) = (red << 10) + (green << 5) + blue;
}
src += w;
dst -= w;
}
HANDLE tga = CreateFile( file, GENERIC_WRITE, FILE_SHARE_READ,
0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 );
WriteFile( tga, tgabuff, size, &bytesread;, 0 );
CloseHandle( tga );
delete tgabuff;
}

at the beginning of your file.
Then, when you want a screenshot, put:
Code:

writetga(_T("screenshot.tga"), SCRWIDTH, SCRHEIGHT, getbuffer());
Thanks Billcow, you saved us a couple of hours coding. The folks as Developer One washed their hands of the GAPI problem so having purchased their screensnap app I'm a bit disappointed that they have to fix in mind. I note that on PocketPC 2002 some apps do break through ( reminders, battery warrnings etc ) so it must be possible.
i coded a screenshot program that works with GAPI aswell. I hope to finish it his weekend. The only problem i have yet to solve is that i can get the contents of the GAPI screen, but i cannot sync this with the refresh, so on most cases you get the screen contents in the middle of a blit to the screen resulting in portions of the screen missing in the screenshot.
I have 2-3 candidates for solving this problem, but i dont really like any of them. Does anyone know of a method to hook up to the GXEndDraw function of GAPI?

cryo