Author |
Topic |
|
Patrick
34 Posts |
Posted - 19 May 2004 : 10:57:48
|
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
|
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. |
|
|
ctacke
877 Posts |
Posted - 19 May 2004 : 12:34:58
|
The Remote Zoom tool works on the device as well. |
|
|
Susan
123 Posts |
Posted - 19 May 2004 : 12:52:57
|
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. |
|
|
ctacke
877 Posts |
Posted - 19 May 2004 : 12:54:52
|
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. |
|
|
Susan
123 Posts |
Posted - 19 May 2004 : 13:01:58
|
Also, CDIBSectionLite takes care of the deprecated GetDIBits with conditional code for _WIN32_WCE. |
|
|
Patrick
34 Posts |
Posted - 21 May 2004 : 11:59:22
|
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.
|
|
|
Susan
123 Posts |
Posted - 21 May 2004 : 12:14:48
|
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 |
|
|
ctacke
877 Posts |
Posted - 21 May 2004 : 13:42:53
|
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.
|
|
|
Patrick
34 Posts |
Posted - 21 May 2004 : 14:20:50
|
How do I create a partnership if I've never been able to make a serial or USB connection work? |
|
|
akidder
1519 Posts |
Posted - 21 May 2004 : 14:40:40
|
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. |
|
|
|
Topic |
|
|
|