ShowColorResDlg example for Delphi

procedure TForm1.ShowColorResDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin
   LEADDlgColor1.DlgFlagsEx:= DLG_COLORRES_SHOW_BITALL Or
                              DLG_COLORRES_SHOW_DITHER_ALL Or
                              DLG_COLORRES_SHOW_PAL_ALL; 

   LEADDlgColor1.DlgFlags:= DLG_COLORRES_SHOW_PREVIEW Or
                             DLG_COLORRES_SHOW_OPENPALFILE Or
                             DLG_COLORRES_SHOW_ORDER Or
                             DLG_COLORRES_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgColor1.LEADImage:= LEADImage1; 
   LEADDlgColor1.LEADDlgService:= LEADDlgService1; 
   nRet:= LEADDlgColor1.ShowColorResDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.ColorRes ( LEADDlgColor1.BitsPerPixel
                            LEADDlgColor1.PaletteFlags
                            LEADDlgColor1.DitherFlags
                            0 ); 
   end; 
end;