|
Draws a rectangle with rounded corners on the canvas.
Delphi 구문:
procedure RoundRect ( X1, Y1, X2, Y2, X3, Y3: Integer );
C++ 구문:
void __fastcall RoundRect ( int X1, int Y1, int X2, int Y2, int X3, int Y3);
설명
Rounded rectangle을 그리려면 RoundRect를 사용하십시오. Rectangle은 point (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2)로 정의된 edge를 가지지만, rounded appearance를 만들기 위해 corner가 깎입니다. Rounded corner의 curve는 width X3 및 height Y3인 ellipse의 curvature와 일치합니다
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.
|