Autor Beitrag
DelWal
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 14.06.05 20:43 
Hi leute hoffe ihr könnt mir mal weiter helfen... :?:

Also ich hab das mit der PaintBox nicht kapiert was is mit Tcanvas und so ? könnte das vielleicht jemand mal erklären oder mir ne gute einfache site geben, weil ich hab nix so richtig gefunden wo ich schlau draus werde :idea: .

Ein Beispiel wie ich n Dreieck zeichne oder so wäre ganz nett ! DANKE !


Moderiert von user profile iconChristian S.: Topic aus Algorithmen, Optimierung und Assembler verschoben am Di 14.06.2005 um 22:00
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 15.06.05 15:12 
Also ich dachte in dem Fall ist die Hilfe sehr ausfuehrlich...
Canvas.MoveTo geht an eine bestimmte Position, Canvas.LineTo malt eine Linie zur angegebenen Position.
Canvas.Brush und Canvas.Pen sind dabei fuer die Attribute wie Farbe und so weiter da.
Na ja und um ein Dreieck zu zeichnen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
PaintBox1.Canvas.MoveTo(10, 10);
PaintBox1.Canvas.LineTo(100, 100);
PaintBox1.Canvas.LineTo(10, 190);
paintBox1.Canvas.LineTo(10, 10);
bocky3
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mi 15.06.05 20:27 
hier mal mit einem beliebig bestimmbaren punkt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var x, y  : integer;
begin
Form1.PaintBox1.Canvas.Create;
x := strtoint(edit1.Text);
y := strtoint(edit2.text);
with Form1.PaintBox1.Canvas do
     begin
       MoveTo(x*10,y*10);
       LineTo(x*10,y*10+2);
     end;
end;


weißte was MoveTo bzw LineTo bedeutet?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 16.06.05 08:30 
Das with hab ich übrigens absichtlich nicht benutzt, denn wenn schon TCanvas ein Problem ist...
bocky3
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 16.06.05 20:57 
auch wieder wahr...
aber so hab ich es nun ma gelernt.^^

@ DelWal frag einfach wenn du was nich verstehst.
ähm... soll jetzt nich blöd klingen aber, was weißt du über koordinatensysteme(2D)?
DelWal Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: So 19.06.05 13:17 
Danke Leute ihr wart ne große Hilfe jetzt funzt alles !

WAs das mit dem Koordinatensys. auf sich hat is mir schon klar^^ hab nur n prob mit der ***** paintbox gehabt

Bis zunm nächsten Problem ^^