ImageEn, unit iemview

TImageEnMView.UnlockUpdate

TImageEnMView.UnlockUpdate


Declaration

function UnlockUpdate(): integer;


Description

Decrement the lock update counter (use after calling LockUpdate).
If the lock count is zero, then Update is called to refresh the view.

Returns the lock count.


Examples

// Disable updating of component
ImageEnMView1.LockUpdate();
try
  ... Perform activities, e.g. appending many files
finally
  // Re-enable updating and call update
  ImageEnMView1.UnlockUpdate();
end;


// Paint frame number on each thumbnail
ImageEnMView1.LockUpdate();
for I := 0 to ImageEnMView1.ImageCount - 1 do
begin
  ImageEnMView1.SelectedImage := I;
  ImageEnMView1.Proc.TextOut(Align_text_near_top,
                             Align_text_near_left,
                             '#' + IntToStr( I + 1 ),
                             'Arial',
                             32,
                             clRed,
                             [fsBold]);
end;
ImageEnMView1.UnlockUpdate();


// Deskew all selected scanned documents
ImageEnMView1.LockUpdate();
try
  for i := 0 to ImageEnMView1.MultiSelectedImagesCount-1 do
  begin
    selIdx := ImageEnMView1.MultiSelectedImages[i];
    bmp := ImageEnMView1.GetTIEBitmap( selIdx );
    try
      proc := TImageEnProc.CreateFromBitmap( bmp );
      try
        nAngle := proc.SkewDetection();
        proc.RotateAndCrop( nAngle, ierBilinear, bmp.Height / bmp.Width, iecaSkewedDocument );
      finally
        FreeAndNil(proc);
      end;

    finally
      ImageEnMView1.ReleaseBitmap( selIdx, True );
    end;
  end;
finally
  ImageEnMView1.UnlockUpdate();
end;