GDI+ (C++6) Copying a bitmap from a DC into a Bitmap object

GDI+ (C++6) Copying a bitmap from a DC into a Bitmap object

Post by Um9u » Sun, 23 Apr 2006 09:58:01


C++ ver.6 SP6
Platform SDK Feb 2003
No MDF

I'm looking for a way to capture an image using the GDI+ functions.
Eg. Using the old GDI you would ...
CreateCompatibleDC
CreatecompatibleBitmap
SelectObject
BitBlt (from the DC into the compatible DC)
Then I could just BitBlt into another DC etc.

I have been searching for something similar in GDI+ for so many hours that
it is embarassing.
The only way I have been able to do it is to go through the above procedure
and then create a Bitmap object using the HBITMAP handle I got from
CreateCompatibleBitmap, but this ends up being more laborious than just using
GDI.

In GDI+ there is a contructor

Bitmap(
INT width,
INT height,
Grpaphics *target
);

that looked promising, but there is no documentation for it apart from
saying that it creates a Bitmap object from a Graphics object, but I couldn't
get it to do anything.

Any way to copy a bitmap from a DC into a Bitmap object without using the
old GDI?

Thanks.

Ron.
 
 
 

1. Copy all data from a:Class A's fields to the namesake fields of b:Class B.

2. Capture image of App#A's window from App#B

How can I capture (an image) of the contents of Application #A window ...
from Application #B. Let's say there are two, totally separate, independent
applications running, #A & #B. From Application #B, I want to locate
Application #A, then locate #A's currently active desktop window and capture
an image of whatever's being shown.

Application #A - I have no idea what programming method/tools were used to
create this app

Application #B (the imager capturer) - will be written using the .NET CLR
and either C# or VB.NET in a Winforms Applications.

Any pointers or help appreciated.
--
F.V.

3. Quick A's to easy(?) Q's appreciated...

4. vlookup prob with all #n/a's

5. Count A's

6. how to conver #n/a's to 0

7. #n/a's

8. Conditional count in range w/#N?A's

9. how to hide #N/A's?

10. best way to sum a column with #N/a's?

11. 'Send As' messages stay in User A's sent folder.

12. CAnnot type lowercAse 'A's Anymore (solved!)

13. CAnnot type lowercAse 'A's Anymore

14. How could I ask Thread B to call B().Method() from inside Thread A's run?

15. lookup only finds #n/a's