Hm, @J.Jay, ich seh da jetzt nicht so ganz den Zusammenhang, was genau hätte ich bei mir denn jetzt ändern sollen?
Naja, hab hier erstmal was anderes:
1. Kreis
Code:
procedure TForm1.FormPaint(Sender: TObject);
var rKreis :integer;
begin
rKreis:=1;
while rKreis <=200 do
begin
canvas.Brush.Style:= bsclear;
canvas.MoveTo(400,400);
canvas.Ellipse (400+rKreis,400+rKreis,400-rKreis,400-rKreis);
rKreis:=rKreis+2;
sleep (30);
end;
end;
end.
2.
Code:
procedure TForm1.FormPaint(Sender: TObject);
begin
canvas.Pen.Color:= clgreen;
canvas.brush.color:= clyellow;
canvas.Rectangle(100,300,400,100);
Canvas.Pen.Color:= clRed;
canvas.Brush.color:= clblue;
Canvas.Ellipse(100,300,400,100);
canvas.Brush.Style:= bsclear;
Canvas.TextOut(20,90, 'Hallo');
end;
end.
3. Quadratische Gleichung
Code:
procedure TForm1.B_losClick(Sender: TObject);
var ra, rb ,rc, rx, rx1, rx2 ,rD :real;
begin
ra:=StrtoFloat(E_a.Text);
rb:=StrToFloat(E_b.Text);
rc:=StrToFloat(E_c.Text);
rD:= (rb)*(rb) - 4*(ra)*(rc);
If ra=0 Then
If rb=0 Then
If rc=0 Then
begin
E_Menge.Text:= ('Alle reellen Zahlen sind Lösungen');
E_Menge2.Text:= ('-');
end
Else
begin
E_Menge.Text:= ('Keine Lösung');
E_Menge2.Text:= ('-');
end
Else
begin
rx:= -rc/rb;
E_Menge.text:= FloatToStr (rx);
E_Menge2.Text:= ('-');
end
Else
If rD>0 Then
begin
rx1:= (-rb - sqrt (rD) )/(2*ra);
rx2:= (-rb + sqrt (rD) )/ (2*ra);
E_Menge.Text:= FloatToStr (rx1);
E_Menge2.Text:= FloatToStr (rx2);
end
Else
if rD=0 Then
begin
rx:= -rb/ (2* ra);
E_Menge.text:= FloatToStr (rx);
E_Menge2.Text:= ('-');
end
Else
begin
E_Menge.text:= ('Keine Lösung');
E_Menge2.Text:= ('-');
end;
end;
end.
4. Linien
Code:
procedure TForm1.FormPaint(Sender: TObject);
var rZahl :integer;
begin
for rZahl := 10 downto 1 do
begin
canvas.MoveTo(100,rZahl*50);
canvas.LineTo(700,rZahl*50); sleep (300);
end;
end;
end.