I am using a sample I saw on this forum for creating thumbnails for a multipage PDF or TIF, but my problem is that the thumbnails are all the same image (page 1). Can you tell me what I'm doing wrong? I am using Delphi 5.
Here is my code:
- Code: Select all
ImageList1.Clear;
ListView1.Items.Clear;
Bitmap := TBitmap.Create;
if MainImage.GetNativeImage <> 0 then begin
For nCpt := 1 To MainImage.PageCount do begin
MainImage.DisplayFrame(nCpt);
nThumbnailID := cImaging1.CreateThumbnailHQ(MainImage.GetNativeImage, 100, 100);
cImaging1.SetNativeImage(nThumbnailID);
Bitmap.Handle := cImaging1.GetHBitmap;
ImageList1.Add(Bitmap,nil);
ListItem := ListView1.Items.Add;
ListItem.Caption := 'Page ' + IntToStr(nCpt);
cImaging1.CloseImage(nThumbnailID);
end;
MainImage.PdfDpiRendering := 120;
MainImage.LockControl := False;
MainImage.DisplayFrame(1);
end;
Thanks for the help!
