S sdenf Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-23 #1 如果Image尺寸一定设置Stretch:=true,要是Image里BMP图比Image或大或小, 如何将现在Image的图象按IMage的尺寸保存下来,俺的分全送了,不够再加
Z zhukewen Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-23 #4 用下面的方法试试: procedure TForm1.Button1Click(Sender: TObject); var Bitmap: TBitmap; r1, r2: TRect; begin Bitmap := TBitmap.Create; Bitmap.Width := Image1.Width; Bitmap.Height := Image1.Height; SetRect(r1,0,0,Bitmap.Width,Bitmap.Height); SetRect(r1,0,0,Image1.Picture.Bitmap.Width,Image1.Picture.Bitmap.Height); Bitmap.Canvas.CopyRect(r1,Image1.Picture.Bitmap.Canvas,r2); Bitmap.SaveToFile('c:/test.bmp'); Bitmap.Free; end;
用下面的方法试试: procedure TForm1.Button1Click(Sender: TObject); var Bitmap: TBitmap; r1, r2: TRect; begin Bitmap := TBitmap.Create; Bitmap.Width := Image1.Width; Bitmap.Height := Image1.Height; SetRect(r1,0,0,Bitmap.Width,Bitmap.Height); SetRect(r1,0,0,Image1.Picture.Bitmap.Width,Image1.Picture.Bitmap.Height); Bitmap.Canvas.CopyRect(r1,Image1.Picture.Bitmap.Canvas,r2); Bitmap.SaveToFile('c:/test.bmp'); Bitmap.Free; end;