⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uarc.pas

📁 Delphi Win32核心API参考光盘源码 本书包含了常用的Windows API函数
💻 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 + -