zoukankan      html  css  js  c++  java
  • Delphi 画箭头

    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;
  • 相关阅读:
    第十二次作业
    Beta 冲刺(7/7)
    Beta 冲刺(6/7)
    Beta 冲刺(5/7)
    Beta 冲刺(4/7)
    Beta 冲刺(3/7)
    Beta 冲刺(2/7)
    第十次作业
    Beta 冲刺(1/7)
    福大软工 · 最终作业
  • 原文地址:https://www.cnblogs.com/cb168/p/4446349.html
Copyright © 2011-2022 走看看