频道分类

Delphi WinAPI: InflateRect - 改变矩形大小

作者:admin 来源: 日期:2020/10/15 23:08:01 人气: 标签:

 
WinAPI: InflateRect - 改变矩形大小
//声明:
InflateRect(
  var lprc: TRect; {要修改的矩形}
  dx, dy: Integer  {变化值}
): BOOL;


//举例:
procedure TForm1.FormPaint(Sender: TObject);
var
  R: TRect;
const
  s = '%d,%d,%d,%d';
begin
  R := Rect(60, 60, 200, 150);

  DrawFocusRect(Canvas.Handle, R);
  Canvas.TextOut(R.Left, R.Top-15, Format(s,[R.Left,R.Top,R.Right,R.Bottom]));

  InflateRect(R, 20, 20);
  DrawFocusRect(Canvas.Handle, R);
  Canvas.TextOut(R.Left, R.Top-15, Format(s,[R.Left,R.Top,R.Right,R.Bottom]));

  InflateRect(R, -40, -40);
  DrawFocusRect(Canvas.Handle, R);
  Canvas.TextOut(R.Left, R.Top-15, Format(s,[R.Left,R.Top,R.Right,R.Bottom]));
end;


//效果图:


上一篇:Delphi WinAPI: FlashWindow - 闪烁窗口下一篇:没有资料