Need some advice people.
I've got a program which performs a screen capture for a specific window -
but this
may not be just one BitBlt - there may be many overlapping BitBlts all into
the
same bitmap.
The resulting HBITMAP then needs to be transferred (NOT using the clipboard)
to a second program - which originally invoked the screen capture - this
design
cannot be helped / changed.
So at some point I need to use a DIB section to transfer the bitmap between
processes.
At the moment I have the following plan:
Process A:
Create a DIB section and memory-mapped file, compatible with current screen
DC.
Duplicate the MMF handle and pass the MMF to the secondary process.
Process B:
Receive MMF handle and create a DIB section using this MMF handle.
Select DIB into memory DC
Capture screen
My concern is that using a "compatible" DIB section which is selected
into a memory DC will be slower for BltBlt's than using a straight DDB. But
at some point I need to use DIBs to transfer the bitmap between processes:
So which is faster:
1. Create a single DIB in the source process and pass this to the second
process
for the capture (slower than using DDB???)
No issues transferring the bitmap because both processes share the same
memory backed by the memory-mapped-file .
2. Create a DDB in second process and capture into this. Once the BitBlt(s)
are complete and the DDB is ready, convert to a DIB section and
pass this back to the source process. Advantage is the capture is
optimal,
but there is extra overhead for the transfer now.
My ultimate aim is to capture the screen from a remote process (which may
have hidden / obscured windows) and then save this bitmap to disk. I've got
the capturing hidden windows working OK...its just the bitmap management
that is slowing me down.
Anyone got any experience / opinions on this??
TIA,
James