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

# TDBImage.UpdateData

Performs actions needed to validate and store the content for the image control.

## Declaration

Source position: dbctrls.pp line 1194

`protected procedure TDBImage.UpdateData(`
`Sender: TObject`
`); virtual;`

## Arguments

`Sender` |  | Object for the event notification.

## Description

UpdateData is a procedure used to validate and store the content for the image control.

UpdateData examines the Picture in the image control to ensure that it has been assigned, and contains image content. The Field in the linked dataset is cleared if either condition is False, and no additional actions are performed in the method.

Otherwise, a BLOB stream is created and used to write the image content to the field in the linked dataset. The OnDBImageWrite event handler is signalled (when assigned) to write a custom image header to the BLOB stream. If OnDBImageWrite is not used, and WriteHeader is True, the file extension for the graphic format is written to the BLOB stream. Finally, the content for the bitmap graphic is written to the BLOB stream.

UpdateData is assigned as the OnUpdateData event handler in the internal TFieldDataLink instance used in the control.

## See also

TDBImage.Field |  | Definition for the field in the linked dataset where the control value is stored.
TFieldDataLink.Field |  | The Field to which the datalink is attached.
TFieldDataLink.OnUpdateData |  | OnUpdateData - event handler for updating any pending changes in the data.