[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBCtrls' (#lcl)

# TDBImage.OnDBImageWrite

Event to write a custom header into image stream.

## Declaration

Source position: dbctrls.pp line 1243

`published property TDBImage.OnDBImageWrite : TOnDBImageWrite read FOnDBImageWrite write FOnDBImageWrite;`

## Description

Use OnDBImageWrite to write a custom header in the image stream. This header could be "decoded" in the handler for the OnDbImageRead event when loading. The header will be followed by the image raw data.

By default, TDbImage will write an image header in order to efficiently identify the image format when loading. This behavior is controlled by the WriteHeader property. If your database will be shared with external applications that do not support this, it is important to not write an image header. This could be achieved by writing an empty handler for OnDbImageWrite. Note that an empty handler has the same effect as setting WriteHeader to False.

OnDbImageWrite has precedence over the WriteHeader property.