ImageEn, unit iexDBBitmaps

TIEDBMultiBitmap

TIEDBMultiBitmap


Description


TIEDBMultiBitmap is a descendant of TIECustomMultiBitmap, but unlike TIEMultiBitmap it links to a datasource to provide access to images stored in a database table.
Generally a TIEDBMultiBitmap is attached to a TImageEnMView to make it DB aware.

TIEDBMultiBitmap supports both images stored within the database as a blob (by setting ImageBlobField) or images stored locally and referenced by a filename field (by setting only FilenameField). You will also need to set DataSource.

TIEDBMultiBitmap can operate in two modes:
- Showing all images in a table (the multi-bitmap will contain one image per table record)
- Showing an image with one or more frames at the current database position (the multi-bitmap will show the image for one database record, which may have multiple frames, e.g. a TIFF)

You can also use TIEDBMultiBitmap to retrieve an image (optionally with multiple frames, like a TIFF) embedded in a database blob field using the data-aware overload of Read.

// Extract an image from a database and save it
MyMBMP := TIEDBMultiBitmap.Create();
MyMBMP.Read( MyTableImageBlob );
MyMBmp.Write( 'D:\MyBlobImage.TIFF' );
MyMBmp.Free;


Demo


  Demos\Database\DBMultiBitmap_AllRecords\DBMultiBitmapFD.dpr
  Demos\Database\DBMultiBitmap_MultiFrame\DBMultiBitmapFD2.dpr



Example


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

  fDBMBitmap := TIEDBMultiBitmap.create( DataSource1, 'Image', 'Name' );
  ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
end;

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


Methods and Properties


General
  Create
  Destroy
  Count
  LockUpdate
  LockUpdateCount
  Modified
  UnlockUpdate


Database - General
  DataSource
  FilenameField
  ImageBlobField
  ImageFormat
  ImagePath
  ImageStorageMode
  Mode
  Update
  UseMemoryStream


Database - All Records Mode
  FilenameFieldIsUnique
  FollowDBCursor
  MaxDisplayRecords


Database - Record Frames Mode
  AutoLoad
  Read (Load from blob/file/stream)
  Write (Save to blob/file/stream)
  LoadImage
  UpdateDatabaseImage


Database Editing
  AppendImage
  DefaultFilename
  DeleteImage
  InsertImage
  JpegQuality
  ReadOnly


Image Access
  CopyToIEBitmap
  GetBitmap
  GetTIEBitmap
  ReleaseBitmap
  SetImage


Image Information
  ImageBitCount
  ImageFilename
  ImageHeight
  ImageTag
  ImageUserPointer
  ImageWidth


Input/Output
  ImageCacheSize
  ImageCacheUseDisk
  GetImageToFile
  GetImageToStream


Input/Output Parameters (Meta-Data)
  DuplicateCompressionInfo
  ParamsEnabled
  Params


Image Manipulation
  Flip
  Resample
  Rotate


 Unique functionality to TIEDBMultiBitmap