RoundRect

function RoundRect(const rec: TRect; radius: integer): TArrayOfPointD; overload;

function RoundRect(const rec: TRectD; radius: double): TArrayOfPointD; overload;


uses Image32, Image32_PNG, Image32_vector, Image32_Extra;
...
var
  path: TArrayOfPointD;
  rec: TRect;
begin
  img := TImage32.Create(256,256);
  rec := Rect(10,30, 256-10, 256-30);
  path := RoundRect(rec, 30);
  DrawPolygon(img, path, frNonZero, $FFCCEEFF);
  DrawLine(img, path, 20, $FF0099FF, esClosed);
  img.SaveToFile('round_rect.png');
  img.Free;
end;