procedure TForm1.Line(x, y, x2, y2: integer);
begin
  canvas.MoveTo(x, y);
  canvas.LineTo(x2, y2);
end;

procedure TForm1.Button1Click(Sender: TObject);

var
  x, y, len: integer;
  r: TRect;

begin
  r := self.ClientRect;
  len := r.Right - r.Left;
  if len < 5 then
    len := 5;
  if len > 10 then
    len := 10;
  canvas.Pen.Color := canvas.Font.Color;
  canvas.Pen.Width := 1;
  canvas.Pen.Style := psSolid;
  x := (r.Right + r.Left + len) div 2;
  y := (r.Top + r.Bottom) div 2;

  //Left Arrow
  Line(x, y, x - len - 1, y);
  begin
    x := x - len + 1;
    Line(x, y - 1, x, y + 2);
    inc(x);
    Line(x, y - 2, x, y + 3);
    inc(x);
    Line(x, y - 2, x, y + 3);
  end;


  //Right Arrow
  x := x + 100;
  Line(x, y, x - len - 1, y);
  begin
    dec(x);
    Line(x, y - 1, x, y + 2);
    dec(x);
    Line(x, y - 2, x, y + 3);
    dec(x);
    Line(x, y - 2, x, y + 3);
  end;
end;

 

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2021-06-25
  • 2021-12-06
  • 2021-11-27
  • 2021-10-05
  • 2021-12-07
  • 2021-10-23
猜你喜欢
  • 2021-09-21
  • 2021-12-26
  • 2022-01-02
  • 2021-08-21
相关资源
相似解决方案