BrowseDir (Thumbnail Browser Control) example for Delphi

Note:

To compile this sample you must use LEADDef Unit.

 

    LEADThumb1.EnableMethodErrors := True;
    LEADThumb1.StopOnError := True;
    
    LEADThumb1.Filter := '*.jpg'; {search for JPEG files;}
    
    LEADThumb1.ThumbnailWidth := 150;
    LEADThumb1.ThumbnailHeight := 150;
    LEADThumb1.ThumbnailBitsPerPixel := 0;
    
    LEADThumb1.MaintainAspect := True;
    LEADThumb1.ForceSize := True;
    LEADThumb1.ThumbnailBackgroundColor :=clGreen;
    
    LEADThumb1.LoadStamp := True;
    LEADThumb1.Resample := True;
    
    LEADThumb1.IncludeSubDirectories := False;
    
    LEADThumb1.ExpandMultipage := False;
    
    LEADThumb1.MaxSizeDisk := 0; {no filesize limit}
    LEADThumb1.MaxSizeMem := 4096000; {set a image size limit}
    
    LEADThumb1.DitherFlags := CRF_STUCKIDITHERING;
    LEADThumb1.PaletteFlags := CRF_FIXEDPALETTE;
    try
          LEADThumb1.BrowseDir ('f:\images\new');
    except
      if LEADThumb1.Error <> ERROR_USER_ABORT then
         ShowMessage(LEADThumb1.ErrorMsg);
    end;