标签:获取 procedure var class 可见 height ima com ons
获取一个点和矩形区域的方法如下:
var R: TRect; procedure TForm5.FormCreate(Sender: TObject); begin RadioGroup1.Items.CommaText := ‘Undo,Rect,RectPoint,Bounds‘; R := Button1.BoundsRect; end; procedure TForm5.RadioGroup1Click(Sender: TObject); begin case RadioGroup1.ItemIndex of 0: Button1.BoundsRect := R; //function Rect(ALeft, ATop, ARight, ABottom: Integer): TRect; 1: Button1.BoundsRect := Rect(50, 50, 100, 80); {50与50是矩形左上角点,100与80是矩形 右下角这个点} //function Rect(const ATopLeft, ABottomRight: TPoint): TRect; 2: Button1.BoundsRect := Rect(Point(50, 50), Point(100,80)); //不发生变化,可见上面10与80就是矩形 右下角这个点 //function Bounds(ALeft, ATop, AWidth, AHeight: Integer): TRect; 3: Button1.BoundsRect := Bounds(50, 50, 100, 80);{50和50是矩形左上角点,100从这个点向右延伸宽度,80是从这个点向下延伸高度} end; end;
标签:获取 procedure var class 可见 height ima com ons
原文地址:http://www.cnblogs.com/del88/p/6713263.html