C
chao987
Unregistered / Unconfirmed
GUEST, unregistred user!
用image.picture.loadfile请入图像后大图像会变形,请问有没有好的解决方法。
附自己想的但不知错在哪里?
mage1.Picture.loadfromfile(extractfilename(openpicturedialog1.FileName));
picturewidth:=image1.picture.width;
pictureheight:=image1.picture.height;
widthtimes:=picturewidth/220;
heighttimes:=pictureheight/185;
if widthtimes>=heighttimes then
smalltimes:=widthtimes else
smalltimes:=heighttimes;
image1.picture.width:=round(picturewidth/smalltimes);
image1.picture.height:=round(picturewidth/smalltimes);
image1.picture.left:=(220-image.showimage.width)div 2;
image1.picture.top:=(185-image.showimage.height)div 2;
编译提示image1.picture.width是只读不可写
附自己想的但不知错在哪里?
mage1.Picture.loadfromfile(extractfilename(openpicturedialog1.FileName));
picturewidth:=image1.picture.width;
pictureheight:=image1.picture.height;
widthtimes:=picturewidth/220;
heighttimes:=pictureheight/185;
if widthtimes>=heighttimes then
smalltimes:=widthtimes else
smalltimes:=heighttimes;
image1.picture.width:=round(picturewidth/smalltimes);
image1.picture.height:=round(picturewidth/smalltimes);
image1.picture.left:=(220-image.showimage.width)div 2;
image1.picture.top:=(185-image.showimage.height)div 2;
编译提示image1.picture.width是只读不可写