ShowFreeHandWaveDlg example for C++ Builder

void __fastcall TForm1::ShowFreeHandWaveDlg1Click(TObject *Sender)
{
   L_INT i; 
   L_INT nRet; 
   L_PINT pAmplitudes= NULL; 
   LEADDlgImgEffect1->Scale = 10; 
   LEADDlgImgEffect1->WaveLength = 5; 
   LEADDlgImgEffect1->FreeHandWaveFlags = FILL_CLR | DIS_FRQ; 
   LEADDlgImgEffect1->Angle = 4500; 
   LEADDlgImgEffect1->FillColor = RGB ( 200, 0, 0 ); 
   LEADDlgImgEffect1->DlgFlags = DLG_FREEHANDWAVE_SHOW_PREVIEW |
                            DLG_FREEHANDWAVE_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgEffect1->LEADImage = LEADImage1; 
   nRet= LEADDlgImgEffect1->ShowFreeHandWaveDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
      pAmplitudes= (L_PINT) malloc ( LEADDlgImgEffect1->AmplitudesCount * sizeof(L_INT) ); 

      for ( i= 0; i < (L_INT)LEADDlgImgEffect1->AmplitudesCount; i ++ ) 
      {
         pAmplitudes[i]= LEADDlgImgEffect1->Amplitudes [i]; 
      }

      LEADImage1->FreeHandWave ( pAmplitudes,
                                 LEADDlgImgEffect1->AmplitudesCount,
                                 LEADDlgImgEffect1->Scale
                                 LEADDlgImgEffect1->WaveLength
                                 LEADDlgImgEffect1->Angle
                                 LEADDlgImgEffect1->FillColor
                                 LEADDlgImgEffect1->FreeHandWaveFlags ); 
      if ( pAmplitudes ) 
        free ( pAmplitudes ); 
   }
}