| Autor |
Beitrag |
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: Fr 28.07.06 16:25
Ich versuche, die Zeichenfunktion von mspaint.exe nachzuprogrammieren. Man öffnet Paint, der 'Stift' ist aktiviert und man malt beliebige Dinge. Das wollte ich selber machen.
Ich benutze ein Image und im OnMouseDown und OnMouseMove verändere ich die Farbe:
Delphi-Quelltext 1:
| image1.canvas.pixels[X,Y] := AColor; |
Geht auch, nur ist die Perfomance schlecht. In Paint sind durchgezogene Linien und bei mir sind ab und zu mal Pixel weiß geblieben, d.h. das Programm kommt mit den Zeichnen nicht nach. Woran liegt so etwas? Wie kann man das lösen?
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 28.07.06 16:54
Mit Canvas.MoveTo und Canvas.LineTo vielleicht?
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
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: Fr 28.07.06 16:55
Born-to-Frag hat folgendes geschrieben: | | Mit Canvas.MoveTo und Canvas.LineTo vielleicht? |
Und was machst du wenn der Benutzer nur einmal klickt?
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 28.07.06 17:01
Dann kommt ein Punkt.. im OnMouseUp einfach nochmal LineTo und bei OnMouseDown MoveTo 
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
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: Fr 28.07.06 17:03
|
|
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: Fr 28.07.06 17:10
Hab ne Idee und probiere sie aus.
|
|
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: Fr 28.07.06 17:20
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 28.07.06 17:43
pixels brauchst du dann aber nicht mehr
EDIT: Bei on MouseMove brauchst du auch kein MoveTo mehr, das macht LineTo schon...
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
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: Fr 28.07.06 22:02
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 28.07.06 22:09
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
|