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;
//效果图:

原文地址:https://www.cnblogs.com/del/p/1066494.html