ImageEn, unit iexDBBitmaps

TIEDBBitmap


Declaration

TIEDBBitmap = class(TIEBitmap);


Description

TIEDBBitmap is a descendant of TIEBitmap, but it links to a datasource to provide access to images stored in a database table.
TIEDBBitmap 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 need to set DataSource.

There are two ways you can use TIEDBBitmap:

Connected to a TTable

By setting the DataSource and ImageBlobField or FilenameField, the TIEDBBitmap will be connected to the database and the content will update with the movement and changes on the table, either automatically (AutoLoad is true) or manually (by calling LoadImage). This is generally used to create a data-aware TImageEnView by setting the external bitmap to a TIEDBBitmap.

// 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;


As an adhoc Bitmap with database access

Use TIEDBBitmap to retrieve images embedded in a database blob field using the data-aware overload of Read.

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



Demos

Demo Description Demo Project Folder Compiled Demo
Simple Database Demo Display of an image stored within a database blob field of the active record using FireDAC and a TIEDBBitmap \Demos\Database\DBDemo_Simple\DBBitmapFD.dpr   
Database Demo Display and editing of an image stored within a database blob field using FireDAC and a TIEDBBitmap \Demos\Database\DBDemo\DemoDB.dpr   
Database Path Demo Display of a locally stored image referenced by a path field in a database using FireDAC and a TIEDBBitmap \Demos\Database\DBPath\DBPath.dpr   
Database Layers Demo Adding annotations to an image stored within a database blob field using FireDAC and a TIEDBBitmap \Demos\Database\DBDemo_Layers\DBDemoLayers.dpr   



Methods and Properties

General
Public Method  AdjustmentsMask
Public Method  Allocate
Public Property  BitAlignment
Public Property  BitCount
Public Property  Clear
Public Property  Contrast
Public Method  Create
Public Method  CreateDIB
Public Method  CreateROIBitmap
Public Method  CreateROICanvas
Public Method  Destroy
Public Method  FreeImage
Public Method  FixChannelOffset
Public Method  FixContrast
Public Property  Height
Public Method  IsEmpty
Public Property  IsVirtual
Public Property  Location
Public Property  MemoryAllocator
Public Property  MinFileSize
Public Property  Origin
Public Property  PixelFormat
Public Method  Resize
Public Property  VclBitmap
Public Property  Width

Database
Public Property  DataSource
Public Property  AutoLoad
Public Property  FilenameField
Public Property  ImageBlobField
Public Property  ImageFormat
Public Property  ImagePath
Public Property  ImageStorageMode
Public Property  JpegQuality
Public Property  LayerMode
Public Property  UseMemoryStream
Public Method  Read (Load from blob/file/stream)
Public Method  Write (Save to blob/file/stream)
Public Method  LoadImage
Public Method  UpdateDatabaseImage

Assignment between Objects
Public Method  Assign
Public Method  AssignImage
Public Method  CopyAndConvertFormat
Public Method  CopyFromDIB
Public Method  CopyFromMemory
Public Method  CopyFromTBitmap
Public Method  CopyFromTDibBitmap
Public Method  CopyFromTIEMask
Public Method  CopyRectTo
Public Method  CopyToTBitmap
Public Method  CopyToTDibBitmap
Public Method  CopyToTIEMask
Public Method  CopyWithMask1
Public Method  CopyWithMask2
Public Method  DrawToTIEBitmap
Public Property  EncapsulatedFromMemory
Public Property  EncapsulatedFromTBitmap
Public Method  EncapsulateMemory
Public Method  EncapsulateTBitmap
Public Method  MergeFromTDibBitmap
Public Method  RenderToTBitmap
Public Method  RenderToTBitmapEx
Public Method  RenderToTIEBitmap
Public Method  RenderToTIEBitmapEx
Public Method  RestoreState
Public Method  SaveState
Public Method  StretchRectTo
Public Method  SwitchTo
Public Method  UpdateFromTBitmap

Input/Output
Public Property  Access (inherited from TIEBaseBitmap)
Public Method  CalcRAWSize
Public Method  GetHash
Public Method  LoadFromResource
Public Method  LoadRAWFromBufferOrStream
Public Property  ParamsEnabled
Public Property  Params
Public Method  SaveRAWToBufferOrStream
Public Property  WicFastLoading

Canvas Access
Public Property  IECanvas
Public Property  Canvas
Public Method  DrawToCanvas
Public Method  Fill
Public Method  FillRect
Public Method  MoveRegion
Public Method  RenderToCanvas

Alpha Channel (Transparency)
Public Property  Alpha
Public Property  AlphaChannel
Public Property  AlphaChannelOpt
Public Property  CanvasCurrentAlpha
Public Method  DrawToCanvasWithAlpha
Public Method  FeatherAlphaEdges
Public Method  HasAlphaChannel
Public Property  IsAlpha
Public Method  MergeAlphaRectTo
Public Method  MergeWithAlpha
Public Method  RemoveAlphaChannel
Public Method  RenderToCanvasWithAlpha
Public Method  SynchronizeRGBA

Pixel Access
Public Method  FreeRow
Public Method  GetRow
Public Method  GetSegment
Public Property  Memory
Public Property  Pixels_ie16g
Public Property  Pixels_ie1g
Public Property  Pixels_ie24RGB
Public Property  Pixels_ie32f
Public Property  Pixels_ie32RGB
Public Property  Pixels_ie48RGB
Public Property  Pixels_ie8
Public Property  Pixels_ieCIELab
Public Property  Pixels_ieCMYK
Public Property  Pixels
Public Property  PPixels_ie24RGB
Public Property  PPixels_ie32RGB
Public Property  PPixels_ie48RGB
Public Property  Rowlen
Public Property  ScanLine
Public Property  TBitmapScanlines
Public Property  VirtualBitmapProvider

Palette and Color
Public Property  Palette (inherited from TIEBaseBitmap)
Public Property  PaletteLength (inherited from TIEBaseBitmap)
Public Property  PaletteUsed (inherited from TIEBaseBitmap)
Public Method  AutoCalcBWValues
Public Property  BlackValue
Public Property  ChannelCount
Public Property  ChannelOffset
Public Property  ColorProfile
Public Method  CopyPaletteTo
Public Property  DefaultDitherMethod
Public Property  Full
Public Method  IsAllBlack
Public Method  IsGrayScale
Public Method  StretchValues
Public Method  SyncFull
Public Property  WhiteValue

Image Manipulation
Public Method  Flip
Public Method  Resample
Public Method  Rotate

IEVision related
Public Method  GetIEVisionImage
Public Method  AssignIEVisionImage

Events
Event  OnChanged
Event  OnLoaded
Event  OnProgress
Event  OnRenderVirtualPixel

 Unique functionality to TIEDBBitmap