SkipFile example for C++ Builder
void __fastcall TForm1::LEADThumb1ThumbnailEvent(TObject *Sender,
TBitmapHandle Bitmap, AnsiString FileName, int nStatusCode,
int nPercent)
{
AnsiString szMsg;
char * p = NULL;
AnsiString StrTmp ;
if (nStatusCode == SUCCESS) //successful thumbnail generation
{
//save thumbnails in a multipage TIFF file
LEADImage1->Bitmap= Bitmap;
LEADImage1->Save ("c:\\temp\\thumbs.tif", FILE_TIF, 24, 0, SAVE_APPEND ) ;
szMsg= FileName + "\n";
szMsg= szMsg + "Format= " + IntToStr(LEADThumb1->InfoFormat) + "\n";
szMsg= szMsg + "Compression= " + LEADThumb1->InfoCompression + "\n";
szMsg= szMsg + "Bits= " + IntToStr(LEADThumb1->InfoBits) + "\n";
szMsg= szMsg + "Width= " + IntToStr(LEADThumb1->InfoWidth) + "\n";
szMsg= szMsg + "Height= " + IntToStr(LEADThumb1->InfoHeight) + "\n";
szMsg= szMsg + "Page= " + IntToStr(LEADThumb1->InfoPage) + "\n";
szMsg= szMsg + "TotalPages= " + IntToStr(LEADThumb1->InfoTotalPages) + "\n";
szMsg= szMsg + "SizeDisk= " + IntToStr(LEADThumb1->InfoSizeDisk) + "\n";
szMsg= szMsg + "SizeMem= " + IntToStr(LEADThumb1->InfoSizeMem) + "\n";
szMsg= szMsg + "XRes= " + IntToStr(LEADThumb1->InfoXRes) + "\n";
szMsg= szMsg + "YRes= " + IntToStr(LEADThumb1->InfoYRes) + "\n";
ShowMessage ( szMsg ) ;
}
else
{
if (nStatusCode == BROWSE_PRELOAD)
{
//check the extension, if it is '.DOC', then skip
StrTmp=UpperCase(FileName);
p = StrRScan( PChar ( StrTmp.c_str() ), '.');
if ( ! strcmp ( p, ".DOC"))
{
LEADThumb1->SkipFile= True;
ShowMessage ( "skipping - " + FileName ) ;
}
}
}
LEADThumb1->ContinueBrowse= true ;//continue the browse oper}
}