![]() |
|
#12
|
|||
|
|||
![]() такая проблема, как нарисовать линию ровно под углом, а то получается не совсем красиво.
![]() Код:
procedure TForm1.FormPaint(Sender: TObject); Var i,j,sum,c:integer; begin i:=1; sum:=0; Lines[i].NachX:=button1.Left+button1.Width; Lines[i].NachY:=button1.top+button1.Height div 2; Lines[i].KonechX:=0; Lines[i].KonechY:=button1.top; form1.canvas.Pen.Color:=clred; form1.Canvas.Pen.Width:=1; form1.Canvas.MoveTo(Lines[i].NachX,Lines[i].NachY); c:=form1.Width div 2; while (c<>form1.Width) do begin form1.Canvas.LineTo(c, Lines[i].KonechY); if PointIntoRect (Lines[i], button3)=true then sum:=strtoint(button3.caption); if PointIntoRect (Lines[i],button2)=true then sum:=sum+strtoint(button2.Caption); c:=c+1; end; |