Map Snapshot throws Access Violation Exception
If the current video color depth is less than 32 bpp, an Access Violation exception is thrown when attempting to capture a Snapshot image of the map.
CImageClass:CBitsToImageBufferWithPadding() required two changes. First, the calculation of bytesPerPixel was incorrect, which was causing the exception. Secondarily, the height specified in the BITMAPINFO struct had to be negated in order to invert the image (top-to-bottom).