如何才能生成高质量的缩略图呢?(我用StretchBlt生成的缩略图惨不忍睹啊)
我用如下方法在ListView中生成缩略图,但惨不忍睹;
有什么其它的高质量生成缩略图的方法吗?
TImageList * SmallBitmap=new TImageList(this);
Graphics::TBitmap * bmpS=new Graphics::TBitmap();
Graphics::TBitmap * bmpD=new Graphics::TBitmap();
TListItem *lvitem;
SmallBitmap->Width=100;
SmallBitmap->Height=100;
SmallBitmap->Clear();
ListView1->Items->Clear();
ListView1->LargeImages=SmallBitmap;
bmpS->LoadFromFile("c:\\111.bmp");
//bmpD->PixelFormat=pf24bit;
bmpD->Width=100;
bmpD->Height=100;
::StretchBlt(bmpD->Canvas->Handle,0,0,100,100,
bmpS->Canvas->Handle,0,0,bmpS->Width,bmpS->Height-0,0xCC0020);
int i=SmallBitmap->Add(bmpD,NULL);
lvitem=ListView1->Items->Add();
lvitem->Caption="111.bmp";
lvitem->ImageIndex=i;
delete bmpS;
delete bmpD;