In using the CF_BITMAP format, you give the clipboard a handle to a bitmap when calling SetClipboardData. The GetClipboardData function returns a handle to a bitmap.
You may recall the BLOWUP1 program from Chapter 4, which allowed you to block out any part of the display and copy it to BLOWUP1's client area. BLOWUP1 used StretchBlt to expand or compress the size of the blocked-out area so that it exactly fit the client area. The program had a problem, however: If part of BLOWUP1's client area was destroyed (perhaps by an overlapping window from another program), BLOWUP1 couldn't recreate it. We could have solved that problem by creating a bitmap based on the size of the area BLOWUP1 was copying. When BLOWUP1 needed to redisplay the bitmap in its client area, it could have selected the bitmap into a memory device context and used StretchBlt to copy it to the client area.
Let's go one step further and write a revised version of this program that uses the clipboard to hold onto this bitmap. This approach provides two advantages:
Any part of the display can now be copied in bitmap format and stored in the clipboard.
Any bitmap that is stored in the clipboard can be copied into and scaled to the size of the program's client area. You can then block out all or part of this display and copy that to the clipboard. This provides an easy manual approach to scaling or cropping bitmaps.