Autor Beitrag
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Di 24.11.09 20:19 
Hi DF!

Ich folgendes Problem:

Ich zeichne auf eine PaintBox, sobald das OnPaintevent abgesetzt wird. Ich sehe dann blaue Schlieren, also zeichnet er - aber nicht permanent?! Und wenn sich etwas über die besagte PaintBox legt, passiert auch nichts. Irgendwas ist da faul. Hier mein Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.FormPaint(Sender: TObject);
var ColI, RowI : Integer;
begin
  if RectLength < RectBroads then //Also Überlappung unmöglich
   ShowMessage('Achtung! Das Schlachtfeld kann nicht ordnungsgemäß gezeichnet werden');
  with PLY_Map do
  begin
    for ColI := 0 to Cols - 1 do
     for RowI := 0 to Rows - 1 do
     Canvas.Rectangle(ColI * RectBroads, RowI *  RectBroads, ColI * RectBroads +
     RectLength ,RowI * RectBroads + RectLength);
     // Col * x + y
     // x = Größe des Rechteckes
     // y = Verschiebung (Breite / Höhe)
  end;
end;
Einloggen, um Attachments anzusehen!
_________________
Die Lösung ist nicht siebzehn.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 24.11.09 20:29 
Könnte daran liegen, dass du das OnPaint des Formulars verwendest.. nicht der PaintBox..

_________________
PROGRAMMER: A device for converting coffee into software.
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Di 24.11.09 21:25 
Klappt. Danke!

_________________
Die Lösung ist nicht siebzehn.