ImageEn, unit imageenproc

TImageEnProc.EndImageAnalysis

TImageEnProc.EndImageAnalysis


Declaration

procedure EndImageAnalysis(ProcBitmap: TIEBitmap);


Description

BeginImageAnalysis and EndImageAnalysis allow you to create custom image analysis functions that automatically handle selection area and pixel format consistency.

Parameter Description
ProcBitmap The bitmap to process

By using BeginImageAnalysis/EndImageAnalysis, you can avoid considering if the selection is rectangle, elliptical, irregular or magic wand, just process the bitmap as a rectangle.


Example

procedure SearchWhitePixel( proc: TImageEnProc );
var
  ProcBitmap: TIEBitmap;
  mask: TIEMask;
  x1, y1, x2, y2: Integer;
  x, y: Integer;
  px: PRGB;
begin
  // we support only ie24RGB format
  if not proc.BeginImageAnalysis([ie24RGB], x1, y1, x2, y2, ProcBitmap, mask) then
    exit;
  for y := y1 to y2-1 do begin
    px := ProcBitmap.Scanline[y];
    for x := x1 to x2-1 do begin
      with px^ do
         if (r = 255) and (g = 255) and (b = 255) then
  ShowMessage('Found White Pixel!');
      inc(px);
    end;
  end;
  // finalize
  proc.EndImageAnalysis(ProcBitmap);
end;

..
ImageEnView1.SelectEllipse( 100, 100, 100, 100 );
SearchWhitePixel( ImageEnView1.Proc );