DTWAIN_FlipBitmap
The DTWAIN_FlipBitmap rotates a Device Independent Bitmap (DIB) 180 degrees and swaps the DIBs color components.
DTWAIN_BOOL DTWAIN_FlipBitmap ( HANDLE hDib );
Parameters hDib Specifies a handle to a Device Independent Bitmap.
Return Values If the function succeeds, TRUE is returned. If the function fails FALSE is returned.
Comments The DTWAIN_FlipBitmap should only be used for correcting the returned DIB from calling DTWAIN_AcquireBuffered and using a user-defined buffer.
The DTWAIN_FlipBitmap function takes a Device Independent Bitmap (DIB) and swaps the color components and rotates the DIB 180 degrees. This function should rarely be used by a DTWAIN application, however it is most useful when an application has called DTWAIN_AcquireBuffered and has set up a user defined buffer to retrieve the image.
Since DTWAIN does not handle the image data for buffered transfers that utilize a user-defined buffer, the application will have to make sure that the returned DIB has been properly inverted and color components swapped, since the returned DIB from the TWAIN device has swapped color components and is "upside-down". Without "flipping" the DIB, the DIB will have the wrong colors and will be upside-down when saved or displayed.
The hDib parameter is the handle to the DIB. On return, the DIB will be rotated 180 degrees and swaps the color components.
TWAIN State Transitions None.
Prerequisite Function Call(s) None. |