SimpleOCR:SDK Functions – DIBToIMG

You are here:
< All Topics

IMG * DIBToIMG(HGLOBAL hDib)

Converts a memory block containing a Device Independent Bitmap (DIB) to an IMG object.

Return Value

A pointer to an IMG object. If the function fails, the return value is NULL.

Parameters

hDib

A HGLOBAL handler referencing a Global Memory object containing a BITMAPINFO structure followed by the bitmap bits.

Comments

See your Windows SDK documentation for obtaining information about Device Independent Bitmaps and how to use it.

Example

Retrieve a DIB from the clipboard and convert it to an IMG object

HGLOBAL hDib; 
IMG *img; 

// Retrieve an IMG from the clipboard 
if (IsClipboardFormatAvailable(CF_DIB) &&
OpenClipboard(hWnd)) { 
hDib=GetClipboardData(CF_DIB); 
img=DIBToIMG(hDib); 
CloseClipboard();
}
Previous SimpleOCR:SDK Functions – DeskewImg
Next SimpleOCR:SDK Functions – EraseBlackBordersImg
Table of Contents
Contact Us for FREE Consultation on Your OCR Project

Share This Story, Choose Your Platform!

OCR Guide
Brands
Compare most popular choices in one cozy and extensive table
Languages
Applications
Go to Top