?? uarc.pas
字號:
unit UArc;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Panel1: TPanel;
PaintBox1: TPaintBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
iCount: Integer; // a general loop control variable
ArcBounds: TRect; // the bounding rectangle of the arc
begin
{initialize the bounding rectangle}
ArcBounds := PaintBox1.BoundsRect;
{initialize the pen used to draw the arcs}
PaintBox1.Canvas.Pen.Width := 2;
{draw 5 arcs}
for iCount := 1 to 5 do
begin
{Draw the arc}
Arc(PaintBox1.Canvas.Handle, ArcBounds.Left, ArcBounds.Top, ArcBounds.Right,
ArcBounds.Bottom,ArcBounds.Right, (ArcBounds.Bottom-ArcBounds.Top)div 2,
ArcBounds.Left, (ArcBounds.Bottom-ArcBounds.Top)div 2);
{reduce the size of the bounding rectangle for the next arc}
InflateRect(ArcBounds, -2, -2);
{change the color of the pen used to draw the next arc}
PaintBox1.Canvas.Pen.Color := PaletteIndex(iCount+10);
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -