ImageEn, unit iexDBBitmaps

TIEDBBitmap.Create

TIEDBBitmap.Create


Declaration

constructor Create(); overload;
constructor Create(aDataSource: TDataSource; const sImageBlobField, sFilenameField: string); overload;


Description

Create a new TIEDBBitmap object.
Second overload creates the bitmap and sets DataSource, ImageBlobField and FilenameField.


Examples

// Create DB Aware TImageEnView
procedure TMainForm.FormCreate(Sender: TObject);
begin
  ... Open a database table ...

  fDBBitmap := TIEDBBitmap.create( DataSource1, 'Image', 'Name' );
  ImageEnView1.SetExternalBitmap( fDBBitmap );
end;

procedure TMainForm.FormDestroy(Sender: TObject);
begin
  FreeAndNil( fDBBitmap );
end;

// Extract an image from a database and save it
MyBMP := TIEDBBitmap.Create();
MyBMP.Read( MyTableImageBlob );
MyBmp.Write( 'D:\MyBlobImage.jpeg' );
MyBmp.Free;