| Autor |
Beitrag |
solic
Hält's aus hier
Beiträge: 3
|
Verfasst: Mi 01.11.06 17:23
hallo,
ich versuche gerade eine funktion in ein koordinatensystem zu zeichen, nur bekomme jetzt folgende fehlermeldung:
Undeclared Identifier: 'Pixels'. Ich kann mir irgendwie nicht erlären warum das nicht funktioniert.
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:
| procedure TMemo1.PaintBox1Click(Sender: TObject); var ax,ay,bx,by,i:integer; x,y:real; term: string; begin with PaintBox1.canvas do begin moveto(PaintBox1.Width div 2,0); lineto(PaintBox1.Width div 2,PaintBox1.Width); moveto(0,PaintBox1.Height div 2); lineto(PaintBox1.Height,PaintBox1.Height div 2);
for ax:=1 to 11 do begin moveto(ax*50,250); lineto(ax*50,255); end; for ay:=1 to 11 do begin moveto(245,ay*50); lineto(250,ay*50); end; for bx:=0 to 3 do textout(48+bx*50,260,inttostr(bx-4)); for by:=0 to 3 do textout(230,443-by*50,inttostr(by-4)); for bx:=5 to 8 do textout(48+bx*50,260,inttostr(bx-4)); for by:=5 to 8 do textout(230,443-by*50,inttostr(by-4)); end;
for i:=0 to 499 do begin x := (i-250)/100; y := x*x*x; Pixels[i, (Paintbox1.Height div 2) - Round(y*15)] := clBlue; end; end; end; |
wenn ich den code so verwende:
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| procedure TForm1.Button1Click(Sender: TObject); var i: Integer; x: Double; y: Double; begin with Paintbox1.Canvas do begin MoveTo(0, Paintbox1.Height div 2); LineTo(Paintbox1.Width, Paintbox1.Height div 2); MoveTo(Paintbox1.Width div 2, 0); LineTo(Paintbox1.Width div 2, Paintbox1.Height); for i:=0 to 499 do begin x := (i-250)/100; y := x*x*x; Pixels[i, (Paintbox1.Height div 2) - Round(y*15)] := clBlue; end; end; end; |
läuft nämlich alles problemlos :S
muss wohl irgendwas mit Pixsels zutun haben , wenn mir da jemand weiterhelfen könnte ? Daaanke
|
|
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Mi 01.11.06 17:34
Du setzt das end zu früh:
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:
| procedure TMemo1.PaintBox1Click(Sender: TObject); var ax,ay,bx,by,i:integer; x,y:real; term: string; begin with PaintBox1.canvas do begin moveto(PaintBox1.Width div 2,0); lineto(PaintBox1.Width div 2,PaintBox1.Width); moveto(0,PaintBox1.Height div 2); lineto(PaintBox1.Height,PaintBox1.Height div 2);
for ax:=1 to 11 do begin moveto(ax*50,250); lineto(ax*50,255); end; for ay:=1 to 11 do begin moveto(245,ay*50); lineto(250,ay*50); end; for bx:=0 to 3 do textout(48+bx*50,260,inttostr(bx-4)); for by:=0 to 3 do textout(230,443-by*50,inttostr(by-4)); for bx:=5 to 8 do textout(48+bx*50,260,inttostr(bx-4)); for by:=5 to 8 do textout(230,443-by*50,inttostr(by-4)); end;
for i:=0 to 499 do begin x := (i-250)/100; y := x*x*x; Pixels[i, (Paintbox1.Height div 2) - Round(y*15)] := clBlue; end; end; end; |
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
|