最好同时能显示图片的文件名  类似ACDSee里面的 “缩略图+描述”

解决方案 »

  1.   

    如果只显示 那么上面的就够了,描述就是个label而已
    ------
    如果想自己缩小,那么下面的代码可以
    procedure TForm1.Button1Click(Sender: TObject);
    var
      bitmap:TBitmap;
    begin
      //缩小到窗体
      Canvas.StretchDraw(rect(0,0,Image1.Width div 2,Image1.Height div 2),
                         Image1.Picture.Graphic);
      //缩小到文件
      bitmap:=TBitmap.Create;
      bitmap.Width:=Image1.Width div 2;
      bitmap.Height:=Image1.Height div 2;
      bitmap.Canvas.StretchDraw(bitmap.Canvas.ClipRect,Image1.Picture.Graphic);
      bitmap.SaveToFile('F:\1.bmp');
      bitmap.Free;
    end;
      

  2.   

    我觉得搂主应该自己从Tpanel继承一个
    加上2个private成员 TImage和TLabel就应该可以达到要求
      

  3.   

    用Image设置属性就行啊
    stretch设成true
    他的前面还有一个属性,使图片只是大小改变,而不拉伸
      

  4.   

    help u up=============================================
      

  5.   

    家里有三本Delphi和一本VB.Net都没看过,想学但没有耐心学。
      

  6.   

    我也觉得应该自己做个控件 就TPanel继承 应该可以不过有没有谁有这方面的代码什么的 或者是现成的东西 我暂时没时间去专门做个控件
      

  7.   

    ①ListBox1的Style設定:lbOwnerDrawFixed ②以下提供的参考Source、自己修正。
    procedure TForm1.FormCreate(Sender: TObject);
    var
      i : Integer;
    const
      BmpDir = 'C:\Program Files\Common Files\Borland Shared\Images\Buttons\';
      BmpFiles : array[0..2] of string = ('Globe.bmp', 'Video.bmp', 'Key.bmp');
      TextList : array[0..2] of string = ('Item1', 'Item2', 'Item3');
    begin
      for i:=0 to 2 do begin
        Bitmaps[i] := TBitmap.Create;
        Bitmaps[i].LoadFromFile(BmpDir+BmpFiles[i]);
        ListBox1.Items.AddObject(TextList[i], Bitmaps[i]);
      end;
    end;procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
    var
      Bitmap: TBitmap;
      Offset: Integer;
    begin
      Offset := 0;
      with (Control as TListBox) do begin
        Canvas.FillRect(Rect);
        Bitmap := TBitmap(Items.Objects[Index]);
        if Bitmap <> nil then begin
          Canvas.Draw(Rect.Left+2, Rect.Top+2, Bitmap);
          Offset := Bitmap.Width + 8;
         end;
         Canvas.TextOut(Rect.Left + Offset, Rect.Top+4,Items[Index]);
      end;
    end;③用TListView也可以。