Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to capture the Desktop Window into a jpeg image?
Message
 
To
07/11/2003 15:00:35
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00847508
Message ID:
00847978
Views:
30
Hi Peter,

I'll try to answer on your questions.

>It seems to me that the Capture method is using BitBlt to capture the image of the Desktop, which I believe is considered as a bitmap, to a newly created bitmap.

Yes, but we have not access to desktop bitmap directly. We have only device context of the desktop and BitBlt copies data from source device context to destination device context (with selected bitmap object). It's a common way to capture window to bitmap.

> 1. Can we just encode the Desktop into JPEG directly?

No. Desktop is not a bitmap. We have to capture it to bitmap first. Also, there no WinAPI (at least, documented) to save JPEGs. We can make it only with GDI+ or some third-party libraries like Intel JPEG Library.

> 2. What is the difference between the source bitmap and destination bitmap used by the BitBlt function?

BitBlt works with device contexts, not bitmaps. In order to obtain direct access to screen content were developed such things as DirectDraw.

> 3. Why do we need to create another bitmap using GdipCreateBitmapFromHBITMAP?

Actually it is not another bitmap, It's a GDI+ object based on GDI object (HBITMAP). We must have GDI+ object, because GDI+ is used for JPEG encoding.

> 4. Does HBITMAP always stand for handle of a bitmap?

Yes, HBITMAP is a GDI handle of bitmap.

Alexander
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform