SkipFile example for Delphi
procedure TForm1.LEADThumb1ThumbnailEvent(Sender: TObject;
Bitmap: TBitmapHandle; FileName: String; nStatusCode, nPercent: Integer);
var
msg: String;
p: PChar;
StrTmp : String ;
begin
if (nStatusCode = SUCCESS) Then //successful thumbnail generation
begin
//save thumbnails in a multipage TIFF file
LEADImage1.Bitmap:= Bitmap;
LEADImage1.Save ('c:\temp\thumbs.tif', FILE_TIF, 24, 0, SAVE_APPEND ) ;
Msg:= Filename + Chr(13);
Msg:= Msg + 'Format: ' + IntToStr(LEADThumb1.InfoFormat) + Chr(13);
Msg:= Msg + 'Compression: ' + LEADThumb1.InfoCompression + Chr(13);
Msg:= Msg + 'Bits: ' + IntToStr(LEADThumb1.InfoBits) + Chr(13);
Msg:= Msg + 'Width: ' + IntToStr(LEADThumb1.InfoWidth) + Chr(13);
Msg:= Msg + 'Height: ' + IntToStr(LEADThumb1.InfoHeight) + Chr(13);
Msg:= Msg + 'Page: ' + IntToStr(LEADThumb1.InfoPage) + Chr(13);
Msg:= Msg + 'TotalPages: ' + IntToStr(LEADThumb1.InfoTotalPages) + Chr(13);
Msg:= Msg + 'SizeDisk: ' + IntToStr(LEADThumb1.InfoSizeDisk) + Chr(13);
Msg:= Msg + 'SizeMem: ' + IntToStr(LEADThumb1.InfoSizeMem) + Chr(13);
Msg:= Msg + '"XRes: ' + IntToStr(LEADThumb1.InfoXRes) + Chr(13);
Msg:= Msg + 'YRes: ' + IntToStr(LEADThumb1.InfoYRes) + Chr(13);
ShowMessage ( Msg ) ;
end
else
begin
If (nStatusCode = BROWSE_PRELOAD) Then
begin
//check the extension, if it is '.DOC', then skip
StrTmp:=UpperCase(Filename);
p := StrrScan( PChar ( StrTmp ), '.');
If (p = '.DOC') Then
begin
LEADThumb1.SkipFile:= True;
ShowMessage ( 'skipping - ' + Filename ) ;
end;
end;
end;
LEADThumb1.ContinueBrowse:= True ;//continue the browse operation
end;