我需要显示某目录中的文件(就象资源管理器,用缩略图方式显示里面的jpg等文件),使用了TshellListView,选中了其中的一项,却得不到Selected的Caption,它居然为空''。请问
1、如何用缩略图方式显示目录里面的jpg等图文件?(50分)
2、如何得到shellListview.Selected.Caption?(50分)

解决方案 »

  1.   

    我在加50分,怎样在TshellListView里面带有复选框
    如果有第三方控件也可以
      

  2.   

    2、shelllistview1.Folders[ShelllistView1.Selected.index].PathName。这个是选中的那个文件或文件夹的全路径名,然后依据需要去截罗。
      

  3.   

    我已经在CSDN中找到了问题2的解决方法。只剩下问题1了。
      

  4.   

    fileName := ShellListView1.SelectedFolder.PathName;
      

  5.   

    把ImageFileList中的图片文件缩放后加载到ImageList1中,并在ListView1中显示procedure SavePicToMiniature(SourceJpg: TJPEGImage; Width, Height: Integer);
    //保存JPEG的缩略图
    var
       jpg: TJPEGImage;
       bmp: TBitmap;
    begin
       bmp := TBitmap.Create;
       bmp.Width := Width;
       bmp.Height := Height;
       bmp.PixelFormat := pf24bit;
       bmp.Canvas.StretchDraw(Rect(0,0,Width,Height), SourceJpg);
       jpg := TJPEGImage.Create;
       jpg.Assign(bmp);
       jpg.SaveToFile('C:\temp\minijpg.jpg');
       bmp.Free;
       jpg.Free;
    end;procedure TForm1.Button1Click(Sender: TObject);
    var AJpg: TJPEGImage;
    begin
       AJpg := TJPEGImage.Create;
       if OpenPictureDialog1.Execute then
       begin
           AJpg.LoadFromFile(OpenPictureDialog1.FileName);
           SavePicToMiniature(AJpg, 320, 240);
           Image1.Picture.LoadFromFile('C:\temp\minijpg.jpg');
       end;
       AJpg.Free;
    end;