Deskew example for Delphi

This example automatically straightens the bitmap and repaints the image. The image to be straightened should be mainly text.

var
   lAngle: Longint;
   RasterProc: LEADRasterProcess;
begin
   RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
   RasterProc.Deskew (LEADRasterView1.Raster, RGB(255, 0, 0), 0);
   lAngle:= RasterProc.DeskewAngle;
   ShowMessage ('Rotation: ' + IntToStr(lAngle) + ' hundredths of degrees');
end;