N nicotine Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-23 #1 当bmp图片的宽和高分别小于image1的宽和高是image1的stretch为false,即不拉伸图片,否则stretch为true,拉伸图片,谢谢!
M mstlq Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-23 #2 stretch属性是让bmp图片根据image控件的大小调整(为ture时)。 要让image控件根据bmp图片的大小调整控件自身大小,请把autosize属性设为ture。
C Cowboy Blues Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-23 #4 autosize属性设为Ture就可以了。
N nicotine Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-24 #5 各位,我的意思是image1大小固定,读取openDialog1打开的一幅bmp,如果bmp大了,就把他压缩为image1的大小并显示,如果bmp小了,就原样显示
N nicotine Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-24 #6 var bmp1:TBitmap; ... bmp1.LoadFromFile('c:/thebmp.bmp'); if (bmp1.Width< image1.Width)and(bmp1.Height<image1.Height)then imgae1.Stretch:=false else image1.Stretch:=true; image1.Picture.Bitmap:=bmp1; 好像是这样?
var bmp1:TBitmap; ... bmp1.LoadFromFile('c:/thebmp.bmp'); if (bmp1.Width< image1.Width)and(bmp1.Height<image1.Height)then imgae1.Stretch:=false else image1.Stretch:=true; image1.Picture.Bitmap:=bmp1; 好像是这样?
E e- Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-24 #8 with Image1 do begin Picture.LoadFormFile('文件名'); Strech := (Picture.Width < Width) or (Picture.Height < Height); end;
with Image1 do begin Picture.LoadFormFile('文件名'); Strech := (Picture.Width < Width) or (Picture.Height < Height); end;
C coolbaby Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-24 #10 用stretchBlt也可以,长宽可以自己控制,设成你的控件大小就可以了,而且还可以画在非TImage的控件上。