The TDib class provides a number of accessor functions that you can use to query a TDib object and get information about the DIB contained in the object:
- To find out whether the object is valid, call the TDib::IsOK function. IsOK takes no parameters. It returns true if the object is valid and false if not.
- The TDib::IsPM function takes no parameters. This function returns true when the DIB is a Presentation Manager-compatible bitmap.
- The TDib::Width and TDib::Height functions return the bitmap's width and height respectively, in pixel units.
- The TDib::Size function returns the bitmap's width and height in pixel units, but contained in a TSize object.
- The TDib::NumColors function returns the number of colors used in the bitmap.
- TDib::StartScan is provided for compatibility with older code. This function always returns 0.
- TDib::NumScans is provided for compatibility with older code. This functions returns the height of the DIB in pixels.
- The TDib::Usage function indicates what mode the DIB is in. This value is either DIB_RGB_COLORS or DIB_PAL_COLORS.
- The TDib::WriteFile function writes the DIB object to disk. This function takes a single parameter, a const char*, which should point to the name of the file in which you want to save the bitmap.
See Also