delphi中image.Canvas的ClipRect区域如何改变呢?!
Image1: TImage;
Button1效果:
Image1.Width := 100;
Iamge1.Height := 100;
with Image1.Canvas.ClipRect do
Caption := Format('%d, %d, %d, %d', [Left, Top, Right, Bottom]);
Button2效果:
Image1.Width := 200;
Iamge1.Height := 200;
with Image1.Canvas.ClipRect do
Caption := Format('%d, %d, %d, %d', [Left, Top, Right, Bottom]);
Button3效果:(welcome.bmp图像的宽高均为300)
Image1.LoadFromFile('c:\test\welcome.bmp');
with Image1.Canvas.ClipRect do
Caption := Format('%d, %d, %d, %d', [Left, Top, Right, Bottom]);
结果呢,Button1、Button2的结果一样,宽高均为100
Button3的结果正常,宽高均为300
问题来了:
我现在不用LoadFromFile方法如何改变Image1.Canvas.ClipRect的宽高呢?!
Button2中ClipRect的宽高均为100,而不是预期的200,这样画图像时就会
部分图像画不上了。
我试着更改Image1的AutoSize、Center、Stretch等属性,没有任何效果。
我在画图时用StretchBlt和BitBlt结合变量bmp(TBitmap类),结果还是
图像只能画出ClipRect中的哪部分,而且ClipRect是不能设置的,惨!!
如果方法比较兴,我可以再加分的。