Vcl.Graphics.DDBsOnly

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

DDBsOnly: Boolean = False; // True = Load all BMPs as device bitmaps.

C++

extern DELPHI_PACKAGE bool DDBsOnly;

Properties

Type Visibility Source Unit Parent
variable public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics Vcl.Graphics

Description

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

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.

See Also