SetSrcRect example for Delphi

This example zooms in on the image by reducing the source rectangle and repaints the image.

var
   sRet: Smallint;
   NewLeft, NewTop, NewWidth, NewHeight: Single;
begin

   NewLeft:= LEADRasterView1.SrcLeft + (LEADRasterView1.SrcWidth * 0.1);
   NewTop:= LEADRasterView1.SrcTop + (LEADRasterView1.SrcHeight * 0.1);
   NewWidth := LEADRasterView1.SrcWidth * 0.8;
   NewHeight := LEADRasterView1.SrcHeight * 0.8;
   if (NewWidth > 1) AND (NewHeight >1) then
      LEADRasterView1.SetSrcRect (NewLeft, NewTop, NewWidth, NewHeight, sRet);
   LEADRasterView1.ForceRepaint (sRet);
end;