TcxCustomImageProperties.GraphicClass Property
Specifies the active image container class.
Declaration
property GraphicClass: TGraphicClass read; write;
Property Value
| Type | Description |
|---|---|
| TGraphicClass | The reference to the active image container class. |
Remarks
Assign a reference to a TGraphic class descendant to the GraphicClass property to use an instance of the corresponding class as the image container accessible through the image editor’s Picture property.
Tip
We recommend that you set the GraphicClass property to TdxSmartImage to ensure that the image editor supports the same image formats as all other DevExpress components.
Code Example: Bind TcxDBImage to Data
The following code example creates a BLOB field in a TdxMemData component and binds a TcxDBImage editor to the field:
uses
dxGDIPlusClasses; // Declares the TdxSmartImage class
// ...
var
AFieldDef: TFieldDef;
begin
if dxMemData1.Active then
dxMemData1.Close;
AFieldDef := dxMemData1.FieldDefs.AddFieldDef;
AFieldDef.Name := 'MyImageField';
AFieldDef.DataType := ftBlob;
AFieldDef.CreateField(dxMemData1);
DataSource1.DataSet := dxMemData1;
DataSource1.Enabled := True;
cxDBImage1.DataBinding.DataSource := DataSource1;
cxDBImage1.DataBinding.DataField := 'MyImageField';
cxDBImage1.Properties.GraphicClass := TdxSmartImage; // Selects the universal container
dxMemData1.Open;
end;
See Also