OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Extending TDib

TDib provides a number of protected functions that are accessible only from within TDib and TDib-derived classes.

You can also access TDib's control data, described in the following table:

Data itemDescription
TDib::InfoA pointer to a BITMAPINFO or BITMAPCOREINFO structure that contains the attributes, color table, and other information about the DIB
TDib::BitsA void pointer that points to an area of memory containing the actual graphical data for the DIB
TDib::NumClrsA long containing the actual number of colors used in the DIB (not the number of colors possible, but the number actually used)
TDib::WAn int indicating the width of the DIB in pixels
TDib::HAn int indicating the height of the DIB in pixels
TDib::ModeA uint16 indicating whether the DIB is in RGB mode (DIB_RGB_COLORS) or palette mode (DIB_PAL_COLORS)
TDib::IsCoreA bool that is true if the Info pointer points to a BITMAPCOREINFO structure and false if it does not
TDib::IsResHandleIndicates whether the DIB was loaded as a resource and therefore whether Handle is a resource handle

You can use the TDib::InfoFromHandle function to fill out the structure pointed to by Info. InfoFromHandle extracts information from Handle and fills out the attributes of the Info structure. InfoFromHandle takes no parameters and has no return value.

The TDib::Read function reads a Windows 3.0-compatible or Presentation Manager-compatible DIB from a file referenced by a TFile object. When loading, Read checks the DIB's header, attributes, palette, and bitmap. Presentation Manager-compatible DIBs are converted to Windows DIBs on the fly. This function returns true if the DIB was read in correctly.

You can use the TDib::LoadResource function to load a DIB from an application or DLL module. This function takes two parameters, an HINSTANCE indicating the application or DLL module from which you want to load the DIB and a TResId indicating the particular resource within that module you want to retrieve. LoadResource returns true if the operation was successful.

You can use the TDib::LoadFile function to load a DIB from a file. This function takes one parameter, a char * that points to a string containing the name of the file containing the DIB. LoadFile returns true if the operation was successful.

See Also