這個問題好象不少貼子有涉及過了,主要就是用Canvas的CopyRect函數
如下代碼,從image1上復制一塊到iamge2上去
Var
width,height,x1,y1,oldx,oldy:integer;
newbitmap:Tbitmap;
begin
image1.canvas.rectangle(x1,y1,oldx,oldy);
width:=abs(x2-x1);
height:=abs(y2-y1);
image2.Width:=Width;
image2.Height:=Height;
newbitmap:=Tbitmap.create;
newbitmap.width:=width;
newbitmap.height:=height;
newbitmap.Canvas.CopyRect(Rect (0, 0, width, Height),image2.canvas,Rect (x1, y1,x2,y2)); // 蕭探
image2.picture.bitmap:=newbitmap; // // 放到 IMAGE2 上
newbitmap.free;
end