FloaterDstClip... example for Delphi

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

var
   AdjustX, AdjustY,
   NewLeft, NewTop,
   NewWidth, NewHeight: Single;
   sRet: Smallint;
begin
   //Set variables to use for adjustment increments.
   AdjustX := LEADRasterView1.ScaleWidth / 20;
   AdjustY := LEADRasterView1.ScaleHeight / 20;
   //Determine new values, based on adjustments of current values.
   NewLeft := LEADRasterView1.FloaterDstClipLeft + AdjustX;
   NewTop := LEADRasterView1.FloaterDstClipTop + AdjustY;
   NewWidth := LEADRasterView1.FloaterDstClipWidth - (2 * NewLeft);
   NewHeight := LEADRasterView1.FloaterDstClipHeight - (2 * NewTop);
   //Set the clipping rectangle to the new values.
   LEADRasterView1.SetFloaterDstClipRect (NewLeft, NewTop, NewWidth, NewHeight, sRet);
end;