想做个Acdsee样式的拇指图?(100分)

  • 主题发起人 主题发起人 c4
  • 开始时间 开始时间
C

c4

Unregistered / Unconfirmed
GUEST, unregistred user!
想做个Acdsee样式的拇指图,已经参考了:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1071229
但觉的界面不好,如拇指图没有立体框......
哪位大侠,有更好的方法?
 
LeadTools的控件
 
谢谢,但是我不想用控件。
 
如果你不嫌麻烦,立体框一样是可以画出来的。举个例子:
procedure TForm1.Button1Click(Sender: TObject);
var bitmap,map:tbitmap;
arect,brect:trect;
w,h,tw,th,tem:integer;
s:string;
begin
w:=64; //缩略图宽
h:=64; //缩略图高
Bitmap := TBitmap.Create;
map := TBitmap.Create;
s:=('D:/Documents and Settings/Administrator/My Documents/My Pictures/wen1.jpg');
image1.picture.LoadFromFile(s);
tw:=image1.Picture.Width;
th:=image1.Picture.height;
Clipboard.Assign(Image1.Picture);
map.LoadFromClipBoardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);
bitmap.Width :=w;
bitmap.height:=h;
bitmap.Canvas.Brush.Color := clBtnFace;
brect.Left := 0;
brect.Top := 0;
brect.Right :=w;
brect.Bottom := h;
bitmap.Canvas.FillRect(brect);
bitmap.Canvas.Brush.Color := clBtnShadow;
bitmap.Canvas.FrameRect(brect);
bitmap.Canvas.MoveTo(0,0);
bitmap.Canvas.Pen.Color := clWhite;
bitmap.Canvas.LineTo(w,0);
bitmap.Canvas.MoveTo(0,0);
bitmap.Canvas.LineTo(0,h);
//bitmap.Canvas.Rectangle(brect);
if(tw<w)and(th<h) then
bitmap.canvas.Draw(w div 2-tw div 2+5,h div 2-th div 2+5,map)
else
begin
if tw>th then
begin
arect.left:=5;
arect.Right:=w-5;
tem:=round(w*(th/tw));
arect.top:=(h-tem) div 2+5;
arect.bottom:=arect.top+tem-5;
end
else
begin
arect.top:=5;
tem:=round(h*(tw/th));
arect.Left :=w div 2- tem div 2+5;
arect.Right:=arect.left+tem-5;
arect.bottom:=h-5;
end;
bitmap.Canvas.StretchDraw(arect,map)
end;
image1.Picture.Bitmap := bitmap;
image1.Picture.SaveToFile('c:/1.jpg');

end;
 
to zw84611:
谢谢!!!
我参考的问题,也是你回答的!
分数奉上。
能否告诉我你的email或msn的ID,还有一些细节问题想请。[:)]
我的email:cao_4@hotmail.com
 
后退
顶部