aggpas: Frame

git-svn-id: trunk@22122 -
This commit is contained in:
mattias 2009-10-12 16:52:22 +00:00
parent 41ddb0f42b
commit 251bb2f596
2 changed files with 25 additions and 4 deletions

View File

@ -54,8 +54,8 @@ begin
FillRect(40,10,50,20);
Ellipse(55,10,65,20);
GradientFill(Rect(70,10,80,20),clRed,clBlue,gdVertical);
//GradientFill(Rect(70,10,80,20),clRed,clBlue,gdVertical);
Frame(85,10,95,20);
end;
// convert to LCL native pixel format
@ -73,6 +73,8 @@ begin
FillRect(40,22,50,32);
Ellipse(55,22,65,32);
GradientFill(Rect(70,22,80,32),clRed,clBlue,gdVertical);
Frame(85,22,95,32);
end;
end;

View File

@ -105,8 +105,11 @@ type
//procedure Arc(ALeft, ATop, ARight, ABottom, angle1, angle2: Integer); virtual;
//procedure Arc(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY: Integer); virtual;
procedure FillRect(const ARect: TRect); virtual;
procedure FillRect(X1,Y1,X2,Y2: Integer);
procedure FillRect(const ARect: TRect); virtual; // no border
procedure FillRect(X1,Y1,X2,Y2: Integer); // no border
procedure Frame(const ARect: TRect); virtual; // border using pen
procedure Frame(X1,Y1,X2,Y2: Integer); // border using pen
procedure GradientFill(ARect: TRect; AStart, AStop: TColor; ADirection: TGradientDirection);
end;
@ -268,6 +271,22 @@ begin
AggDrawPath(AGG_FillOnly);
end;
procedure TAggLCLCanvas.Frame(const ARect: TRect);
begin
Frame(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom);
end;
procedure TAggLCLCanvas.Frame(X1, Y1, X2, Y2: Integer);
begin
Path.m_path.remove_all;
Path.m_path.move_to(X1+0.5,Y1+0.5);
Path.m_path.line_to(X2+0.5,Y1+0.5);
Path.m_path.line_to(X2+0.5,Y2+0.5);
Path.m_path.line_to(X1+0.5,Y2+0.5);
AggClosePolygon;
AggDrawPath(AGG_StrokeOnly);
end;
procedure TAggLCLCanvas.GradientFill(ARect: TRect; AStart, AStop: TColor;
ADirection: TGradientDirection);
begin