Why do these functions have separate arguments for hDC and Bitmap handles? Since the Bitmap is going to be selected into the DC, why don't these functions just use the DC's handle (the hDC) for getting at the image data. Why do these functions require 2 separate handles? And what information about the image do they get from each of these objects (the DC, and the Bitmap)? Furthermore, why do these functions then further also require a BitmapInfoHeader structure to be passed to them? Don't these functions get all the info they need about the picture in question from the Bitmap and DC objects, who's handles you pass to these functions?
Since you pass separate DC and Bitmap handles to the GetDIBits and SetDIBits functions, does the Bitmap not need to be selected into the DC, when using these functions? Can I just use GetDC(0) to get the main screen's DC, or CreateCompatibleDC(0) to create a temporary DC, to act as a kind of "dummy" DC for filling the hDC argument in the GetDIBits or SetDIBits functions, while the actual Bitmap (who's bits I want to Get or Set) is on its own (not selected into the DC)?
Since you pass separate DC and Bitmap handles to the GetDIBits and SetDIBits functions, does the Bitmap not need to be selected into the DC, when using these functions? Can I just use GetDC(0) to get the main screen's DC, or CreateCompatibleDC(0) to create a temporary DC, to act as a kind of "dummy" DC for filling the hDC argument in the GetDIBits or SetDIBits functions, while the actual Bitmap (who's bits I want to Get or Set) is on its own (not selected into the DC)?