|
캔버스에 모서리가 둥근 사각형을 그립니다
Delphi syntax:
procedure RoundRect ( X1, Y1, X2, Y2, X3, Y3: Integer );
C++ syntax:
void __fastcall RoundRect ( int X1, int Y1, int X2, int Y2, int X3, int Y3);
Description
RoundRect로 둥근 사각형을 그립니다. 사각형의 변은 점 (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2)로 정의되지만, 모서리는 깎여 둥근 모양이 됩니다. 둥근 모서리의 곡률은 폭 X3, 높이 Y3인 타원의 곡률과 같습니다
To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.
Code Example
program RoundRect;
{$APPTYPE CONSOLE}
uses
SysUtils, Graphics, Classes, HPDFDoc;
var
HPDF: THotPDF;
const
DashArray: array[0..3] of Byte = (6, 4, 2, 4);
begin
HPDF := THotPDF.Create(nil);
try
HPDF.AutoLaunch := true; // PDF file will be shown automatically
HPDF.FileName := '\RoundRect.pdf'; // Set PDF filename
HPDF.BeginDoc; // Create PDF file
HPDF.CurrentPage.SetDash( DashArray, 0 ); // Set - . - dash pattern
HPDF.CurrentPage.RoundRect( 10, 10, 200, 100, 20, 20 ); // Draw round rect
HPDF.CurrentPage.Stroke; // and stroke
HPDF.EndDoc; // Close PDF file
finally
HPDF.Free;
end;
end.
|