ShowRemapIntensityDlg example for Delphi

procedure TForm1.ShowRemapIntensityDlg1Click(Sender: TObject); 
var
   i: L_INT; 
   nRet: L_INT; 
begin
   LEADDlgColor1.Channel:= CHANNEL_RED; 
   LEADDlgColor1.DlgFlags:= DLG_REMAPINTENSITY_SHOW_PREVIEW Or
                             DLG_REMAPINTENSITY_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgColor1.LEADImage:= LEADImage1; 
   LEADDlgColor1.LEADDlgService:= LEADDlgService1; 
   nRet:= LEADDlgColor1.ShowRemapIntensityDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      for i:= 0 to LEADDlgColor1.RemapIntensityTableSize -1 do
      begin
         LEADImage1.RemapTable[i]:= LEADDlgColor1.RemapIntensityTable [i]; 
      end; 
      LEADImage1.RemapIntensity ( LEADDlgColor1.Channel ); 
   end; 
end;