FreeHandShear example for Delphi
procedure TForm1.FreeHandShearClick(Sender: TObject);
var
apUserPoint: Array [ 0..3 ] of TPoint;
papUserPoint: pPOINT;
Amplitudes: Array [ 0..12 ] of L_INT;
pAmplitudes: L_PINT;
nMax, i: L_INT;
begin
apUserPoint [0].x := 0;
apUserPoint [0].y := 0;
apUserPoint [1].x := 3;
apUserPoint [1].y := 10;
apUserPoint [2].x := 9;
apUserPoint [2].y := -10;
apUserPoint [3].x := 12;
apUserPoint [3].y := 0;
pAmplitudes:= @Amplitudes;
papUserPoint:= @apUserPoint;
LEADImage1.GetCurvePoints( papUserPoint, 4, pAmplitudes, Nil, GUB_LINEAR );
nMax:= 0;
for i:= 0 to 12 do
begin
if(nMax < Amplitudes [i]) then
nMax:= Amplitudes [i];
end;
if ( nMax > 0 ) then
begin
for i:= 0 to 12 do
begin
Amplitudes [i]:= Trunc((1000 * Amplitudes [i] / abs(nMax)));
end;
end;
LEADImage1.FreeHandShear( pAmplitudes, 13, 100, 0, FILL_RPT Or SHR_HORZ );
end;