Reading bar codes from memory bitmaps using ScanBarCodeFromBitmap
The ScanBarCodeFromBitmap function allows you to read bar codes from memory bitmaps rather than image files held on disk. The function takes a handle to a bitmap as the parameter rather than the path to a file containing the image. It is normally referred to as an HBITMAP by programmers. You can create a bitmap handle from a BITMAP structure using the CreateBitmapIndirect function. Note that the calling program is responsible for deleting the bitmap handle, so don’t write code such as:
ScanBarCodeFromBitmap(CreateBitmapIndirect(pBitmap))
Instead tidy it up for yourself with something like:
HBITMAP hBitmap = CreateBitmapIndirect(pBitmap)
ScanBarCodeFromBitmap(hBitmap)
DeleteObject(hBitmap)