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

TDBImage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TDBImage - a data-aware Image box to display a single image from a dataset.

Declaration

Source position: dbctrls.pp line 1164

type TDBImage = class(TCustomImage)

protected

  procedure Notification(); override;

  

Handles notifications when a component in the class instance is added or removed.

  procedure DataChange();

  

Performs actions needed when the content in the linked dataset has been changed.

  procedure UpdateData(); virtual;

  

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

  procedure PictureChanged(); override;

  

Performs actions needed when the Picture property in the image control has been changed.

  class procedure WSRegisterClass; override;

  

Register the component class with the widgetset.

  procedure DoCopyToClipboard;

  

Implements the clipboard Copy (Ctrl+C) command.

public

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  function ExecuteAction(); override;

  

Provides support for TBasicAction in the control.

  function UpdateAction(); override;

  

Updates the specified action to reflect the current state in the linked dataset.

  property Field: TField; [r]

  

Definition for the field in the linked dataset where the control value is stored.

  procedure Change; virtual;

  

Notifies the linked dataset when the value in the control is changed.

  procedure LoadPicture; virtual;

  

Loads the graphic content for the control from a field in the linked dataset.

  procedure CopyToClipboard;

  

Performs actions needed for the Clipboard Copy (Ctrl+C) command.

  procedure CutToClipboard;

  

Performs actions needed for the Clipboard Cut (Ctrl+C) command.

  procedure PasteFromClipboard;

  

Performs actions needed for the Clipboard Paste (Ctrl+V) command.

  property PictureLoaded: Boolean; [r]

  

Indicates if the graphic content for the data-aware control has been loaded from its linked dataset.

published

  property Align: TAlign;

  

Specifies the placement of the control on its Parent control.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AntialiasingMode: TAntialiasingMode;

  

Indicates if anti-aliasing is used when rendering the image.

  property AutoDisplay: Boolean; [rw]

  

AutoDisplay - if True, automatically displays when focus is given.

  property AutoSize: Boolean;

  

Allows automatic adjustment of the size for the control, according to its content.

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property Center: Boolean;

  

Indicates if the image should be centered.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DataField: string; [rw]

  

Contains the name of the field with the value for the control.

  property DataSource: TDataSource; [rw]

  

Provides access to the dataset with content for the control.

  property DragCursor: TCursor;

  

The cursor shape shown during a drag operation.

  property DragKind: TDragKind;

  

Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.

  property DragMode: TDragMode;

  

Determines how a drag operation is started for the control.

  property KeepOriginXWhenClipped: Boolean;

  

Preserves the Left coordinate when a clipped image is centered.

  property KeepOriginYWhenClipped: Boolean;

  

Preserves the Top coordinate when a clipped image is centered.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDblClick: TNotifyEvent;

  

Event handler signalled when a mouse double click occurs in the control.

  property OnDBImageRead: TOnDBImageRead; [rw]

  

Event to read a custom header from image stream.

  property OnDBImageWrite: TOnDBImageWrite; [rw]

  

Event to write a custom header into image stream.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property OnDragDrop: TDragDropEvent;

  

Event handler signalled when an object is dropped onto the control.

  property OnDragOver: TDragOverEvent;

  

Event handler signalled when a control is dragged over the control instance.

  property OnEndDrag: TEndDragEvent;

  

Event handler signalled for the end of a drag-drop operation.

  property OnMouseDown: TMouseEvent;

  

Event handler signalled when a mouse down event is handled for the control.

  property OnMouseEnter: TNotifyEvent;

  

Event handler signalled when the mouse pointer has entered the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler signalled when the mouse pointer has left the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler signalled when the mouse pointer is moved in the control.

  property OnMouseUp: TMouseEvent;

  

Event handler signalled when a mouse up event is handled for the control.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler signalled for a downward movement of the mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler signalled for an upward movement of the mouse wheel.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnStartDrag: TStartDragEvent;

  

Event handler signalled for the start of a dragging operation.

  property ParentShowHint: Boolean;

  

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

  property Proportional: Boolean;

  

True if image is proportional.

  property QuickDraw: Boolean; [rw]

  

QuickDraw - if True, quick drawing is implemented.

  property ReadOnly: Boolean; [rw]

  

Indicates if the control cannot modify the image in the field for the linked dataset.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property Stretch: Boolean;

  

Indicates if the image is resized to the client area for the control.

  property StretchInEnabled: Boolean;

  

Allows the image to be resized proportionally when the image drawing area is shrunk.

  property StretchOutEnabled: Boolean;

  

Allows the image to be resized proportionally when the image drawing area is expanded.

  property Transparent: Boolean;

  

Indicates if the image has a clear, non-opaque background.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

  property WriteHeader: Boolean; [rw]

  

Write a header in the image stream.

end;

Inheritance

TDBImage

  

TDBImage - a data-aware Image box to display a single image from a dataset.

|

TCustomImage

  

Implements the base class for TImage.

|

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TDBImage is a TCustomImage descendant which implements a data-aware image control. TDBImage is used to retrieve or save a graphic image in a field in a dataset. The field is generally a Binary Large Object (BLOB). The control allows use of clipboard operations, like Copy/Cut/Paste to add or update the content in the image.

If an application doesn't need the data-aware capabilities of TDBImage, use a TImage control.

TDBImage, like most data-aware controls, provides DataSource and DataField properties to connect the control to a dataset and field. Internally, it uses a TFieldDataLink to maintain an association between the control and its database-related configuration settings.

Use the AutoDisplay, AutoSize, Stretch, Proportional, and Transparent properties to determine the display and sizing behavior for the graphic image.

See also

How To Use Data-aware Controls

  

HowToUseDataAwareControls - Hints for accessing databases.


Version 3.2 Generated 2024-02-25 Home