RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Graphics.DDBsOnly Variable

Determines whether bitmap handles are created as device-dependent bitmaps (DDB).

Pascal
DDBsOnly: Boolean = False;
C++
Boolean DDBsOnly = False;

Graphics

Set DDBsOnly to force all bitmap handles to be created as device-dependent bitmaps (DDB). The default bitmap handle format is DIB (device-independent bitmap).  

Setting DDBsOnly to true undercuts much of the graphics architecture; it should not be used unless it is absolutely required. Examples of when to set it to true are:  

A graphics-intensive application does bitmap operations that Windows does not support with DIBs; you can either set each bitmap object to DDB before you access its handle property, or you can set this global variable to Truetrue.  

An application uses hundreds of very small bitmaps. Each DIB consumes a separate 4k memory page. DIBs are less efficient for storing many small images than DDBs. Before resorting to changing the DDBsOnly flag to address this, however, consider switching your code to use image lists instead of individual tiny bitmaps. Image lists are more efficient than DIBs and DDBs for storing many same-size small images.

Note: Setting DDBsOnly to true introduces the issue of image alteration. When a BMP file or resource is loaded into a DDB, the color information in the original image is changed to fit the pixel format of the current video device and mode. If you read an image, touch its handle, and write it out, you will not get the same file you read in. DIBs solve this problem. Do not change DDBsOnly unless you have a specific need for device-dependent bitmaps and are willing to accept the image-altering DDB side effects.
 

 

GetDIB 

TImageList

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!