All Forums
 Microsoft Windows CE
 eVC Application Development
 Saving Bitmaps (application screenshots)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

Patrick

34 Posts

Posted - 19 May 2004 :  10:57:48  Show Profile  Email Poster
Hi all, I hope someone can lend me a hand.
My application has progressed enough that I need to make screenshots of my program for its operator’s manual. When I wasn't looking, they started taking photos of the LCD screen, needless to say, it looks like crap. I'd like to do it the right way, by having my program create a series of image files. I was wondering if anyone had any experience in dumping a device context to a file. All of the examples I can find rely on GetDIBits, which seems to be deprecated in CE.
The file format doesn't matter; I can always convert it in Photoshop later. Also, I can not capture the screens using ActiveSync, it has to be done programmatically by my app.
Thanks,
-Patrick

Susan

123 Posts

Posted - 19 May 2004 :  11:33:23  Show Profile  Email Poster
Please check Topic 1302. Also, do you have your application running on the emulator, and are you using eVC 4.0? If so, Remote Zoomin on the Tools menu should work.
Go to Top of Page

ctacke

877 Posts

Posted - 19 May 2004 :  12:34:58  Show Profile  Email Poster
The Remote Zoom tool works on the device as well.
Go to Top of Page

Susan

123 Posts

Posted - 19 May 2004 :  12:52:57  Show Profile  Email Poster
I have also implemented CDIBSectionLite found on CodeProject? CodeGuru? with success.

I have had no luck using Remote Zoomin on a device with a monochrome display. The resulting bitmap is completely black. With a color display, the Remote Zoomin utility works fine.
Go to Top of Page

ctacke

877 Posts

Posted - 19 May 2004 :  12:54:52  Show Profile  Email Poster
Interesting and thanks for the note. I'd not tried it with monochrome. Come to think of it, the Remote Display powertoy for Pocket PCs actually works on our devices too, and it can be used for screen captures.
Go to Top of Page

Susan

123 Posts

Posted - 19 May 2004 :  13:01:58  Show Profile  Email Poster
Also, CDIBSectionLite takes care of the deprecated GetDIBits with conditional code for _WIN32_WCE.
Go to Top of Page

Patrick

34 Posts

Posted - 21 May 2004 :  11:59:22  Show Profile  Email Poster
Susan, that conditional code takes out the ::Save function, as far as I can tell. The function still uses GetDIBits, and that doesn't work on Windows CE.
My application does not function on the emulator due to external hardware, and I've never been able to get ActiveSync to work correctly. Is there any way to even start ActiveSync if you don't have a touch screen on your device?
I wish writing for Bitsy Plus was as easy as my Pocket PC. It just sits in the cradle all day, and when I hit compile, it just pops up the updated app on screen. The SDK is complete for it, and all the tools work. I guess ADS customers must become very good friends with Platform Building to overcome these issues.
Thanks for your help, Susan.

Go to Top of Page

Susan

123 Posts

Posted - 21 May 2004 :  12:14:48  Show Profile  Email Poster
Hi Patrick,

I use this class to allow the user to save bitmaps to a file. Granted, they have to edit the bitmap and remove the Save Bitmap button, but it still works.

This is the code that is executed when the user hits the Save Bitmap button. Please note that the last function, the Save, is using a parameter which is passed to this function.

CBitmap bitmap;
CWindowDC dc(this);
CDC memDC;
CRect rect;
CDIBSectionLite myBitmap;
BOOL bRet;

memDC.CreateCompatibleDC(&dc);

this->GetWindowRect(rect);

bitmap.CreateCompatibleBitmap(&dc, rect.Width(),rect.Height() );

CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(),rect.Height(), &dc, 0, 0, SRCCOPY);

memDC.SelectObject(pOldBitmap);

bRet = myBitmap.SetBitmap(bitmap);
bRet = myBitmap.Save(sFileName);

return(bRet);

See if this gets you any further.

If you'd like a copy of the CDIBSectionLite class which I'm using (since it may be different from the one you found), just email me through ADS with your email address.

Also, I don't use Platform Builder.

This is functioning on both the Bitsy and BitsyX.

Edited by - Susan on 21 May 2004 12:46:30
Go to Top of Page

ctacke

877 Posts

Posted - 21 May 2004 :  13:42:53  Show Profile  Email Poster
Patrick,

ActiveSync is initialted by running repllog.exe on the device. THis can be done with a mouse or keyboard or programmatically with CreateProcess. It should get "automagically" launched with the detection of a USB connection, but to do much debugging work, you really need to use Ethernet as ity's substantially faster. This is done by running repllog.exe with the /remote command-line parameter. Again, this can be done using a keyboard and you must have created a partnership with the device. All of the remote tools then use this connection as their transport layer.

Pocket PCs simply run repllog.exe when it detects the cradle connection. Functionally they work identically to our devices from that point on.
Go to Top of Page

Patrick

34 Posts

Posted - 21 May 2004 :  14:20:50  Show Profile  Email Poster
How do I create a partnership if I've never been able to make a serial or USB connection work?
Go to Top of Page

akidder

1519 Posts

Posted - 21 May 2004 :  14:40:40  Show Profile  Email Poster
Patrick, take a look at the TCP/IP debugging method posted at topic 25. For customers who for some reason or other have trouble getting going with ActiveSync, TPC/IP debugging is a very effective alternative. I prefer this method over ActiveSync, myself.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000