FreeHandShear example for C++ Builder
void __fastcall TForm1::FreeHandShearClick(TObject *Sender)
{
TPoint apUserPoint [ 4 ];
TPoint* papUserPoint;
L_INT Amplitudes [ 13 ];
L_PINT pAmplitudes;
L_INT nMax, i;
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, NULL, GUB_LINEAR );
nMax= 0;
for (i= 0; i < 13; i ++ )
{
if(nMax < Amplitudes [i])
nMax= Amplitudes [i];
}
if ( nMax > 0 )
{
for (i= 0; i < 13; i ++ )
{
Amplitudes [i]= (L_INT)((1000 * Amplitudes [i] / abs(nMax)));
}
}
LEADImage1->FreeHandShear( pAmplitudes, 13, 100, 0, FILL_RPT | SHR_HORZ );
}