Glossary Item Box
This function retrieves a handle to hImage in DIB format.
|
Parameter |
Type |
Description |
|
hImage |
HANDLE |
Identifies the Image whose bits should be retrieved. |
|
bNewDib |
BOOL |
If false, the function returns a handle to ImageMan's internal DIB; if true, ImageMan allocates a new DIB and returns that (in this case, the caller is responsible for the returned handle). |
|
lpRect |
LPRECT |
Specifies the rectangular portion of the image to be retrieved. If this parameter is NULL, the entire image is retrieved. |
Return Value
If the bNewDIB parameter is FALSE then the return value is a handle to ImageMan's internal DIBSECTION bitmap. If bNewDIB is TRUE then the return value is a global handle to a packed DIB if the function is successful, NULL if not.
Comments
This function should be used to retrieve a copy of the internal bitmap in DIB format. The DIB format maintains all the color information of the original image and can be accessed by calling GlobalLock to return a pointer to the data.
If the returned handle is to a DIBSECTION then the handle can only be accessed using the Windows GDI functions and not using GlobalLock.
To gain access to the image's internal bits use the ImgGetDIBPtr and ImgGetDataPtr functions.
Note
ImgGetDIB works only with raster images; using this function on vector images will result in an IMG_BAD_TYPE error being returned to your application.
Copyright 2008 Data Techniques, Inc. All Rights Reserved