summaryrefslogtreecommitdiff
path: root/unit3.pas
blob: 87d7e0bd608c7a6f49f086fde2eb8743e4ce9d89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
unit Unit3;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls;

type

  { TForm2 }

  TForm2 = class(TForm)
    Image1: TImage;
    procedure FormResize(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.lfm}

{ TForm2 }

procedure TForm2.FormResize(Sender: TObject);
var
  w,h: longint;
begin
  image1.free;
  image1:=tImage.create(self);
  image1.left:=0;
  image1.top:=0;
  image1.height:=form2.clientHeight;
  image1.width:=form2.clientWidth;
  image1.parent:=self;
  w:=image1.width;
  h:=image1.height;
  with image1.canvas do begin
    rectangle(-10,-10,w+10,h+10);

    moveTo(round(0.05*w),round(0.65*h));
    lineTo(round(0.15*w),round(0.65*h));
    rectangle(round(0.15*w),round(0.675*h),round(0.25*w),round(0.625*h));
    textout(round(0.15*w),round(0.675*h),'R1');
    moveTo(round(0.25*w),round(0.65*h));
    lineTo(round(0.35*w),round(0.65*h));
    rectangle(round(0.35*w),round(0.675*h),round(0.45*w),round(0.625*h));
    textout(round(0.35*w),round(0.675*h),'R2');
    moveTo(round(0.45*w),round(0.65*h));
    lineTo(round(0.55*w),round(0.65*h));

    moveTo(round(0.5*w),round(0.65*h));
    lineTo(round(0.5*w),round(0.75*h));

    moveTo(round(0.47*w),round(0.75*h));
    lineTo(round(0.53*w),round(0.75*h));
    moveTo(round(0.47*w),round(0.775*h));
    lineTo(round(0.53*w),round(0.775*h));
    textout(round(0.53*w),round(0.75*h),'C2');

    moveTo(round(0.5*w),round(0.775*h));
    lineTo(round(0.5*w),round(0.875*h));

    moveTo(round(0.475*w),round(0.875*h)); // Masse
    lineTo(round(0.525*w),round(0.875*h));

    moveTo(round(0.27*w),round(0.525*h));
    lineTo(round(0.33*w),round(0.525*h));
    moveTo(round(0.27*w),round(0.55*h));
    lineTo(round(0.33*w),round(0.55*h));
    textout(round(0.33*w),round(0.525*h),'C1');

    moveTo(round(0.3*w),round(0.55*h));
    lineTo(round(0.3*w),round(0.65*h));

    moveTo(round(0.3*w),round(0.525*h));
    lineTo(round(0.3*w),round(0.425*h));
    lineTo(round(0.8*w),round(0.425*h));
    lineTo(round(0.8*w),round(0.6*h));

    moveTo(round(0.85*w),round(0.6*h));
    lineTo(round(0.75*w),round(0.6*h));
    lineTo(round(0.55*w),round(0.5*h));
    lineTo(round(0.55*w),round(0.7*h));
    lineTo(round(0.75*w),round(0.6*h));

    moveTo(round(0.5*w),round(0.425*h));
    lineTo(round(0.5*w),round(0.55*h));
    lineTo(round(0.55*w),round(0.55*h));
  end;
  image1.visible:=true;
end;

end.