Autor Beitrag
willy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: So 14.05.06 20:01 
Hallo ich habe ein Problem mit dem Folgenden Quelltext:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.malen(round: integer);
begin
with Image1.Canvas do
begin
  Brush.Color := clBtnFace;
  Rectangle(0,0,Image1.Width,Image1.Height);
  Brush.Color := $FFFFFF;
  Pen.Color := $FF00FF;
  Pen.Width := 4;
  case round of
  1: RoundRect(45,100,165,200,15,15);
  2: RoundRect(185,100,305,200,15,15);
  3: RoundRect(325,100,445,200,15,15);
  4: RoundRect(465,100,585,200,15,15);
  5: RoundRect(45,230,165,330,15,15);
  6: RoundRect(185,230,305,330,15,15);
  7: RoundRect(325,230,445,330,15,15);
  8: RoundRect(465,230,585,330,15,15);
  end;
end;


Also je nach dem Status der Variable round wird ein anderes Rechteck gemalt.
Am Anfang wird die alte Fläche resetet (übermalt), dann wird eine Randfarbe festgelegt und ein neues Rechteck gemalt.
Mein Problem nun: die Randfarbe. Beim ersten mal wird sie ganz normal gemalt, bei den Übrigen sieht man sie nicht, ich habe nun heruasgefunden, dass sie clBtnFace ist...kann mir vll jemand sagen warum?

Schonmal danke WIlly
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mo 15.05.06 08:36 
Ich sehe erstmal keinen Fehler,
hast du vielleicht noch was exotisches eingestellt wie einen anderen Drawmode oder sowas?
willy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Mo 15.05.06 09:28 
nope.. :(
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 15.05.06 10:26 
setze mal vor dem Rechteck
ausblenden Delphi-Quelltext
1:
2:
Pen.Width :=1; //und
Pen.Color := clRed; //zBsp

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!


Zuletzt bearbeitet von Kroko am Mo 15.05.06 11:17, insgesamt 1-mal bearbeitet
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 15.05.06 11:13 
ausblenden volle Höhe Delphi-Quelltext
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:
private
    procedure malen(round: integer);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.malen(round: integer);
begin  
 with Image1.Canvas do
  begin
   Pen.Width :=4;
   Brush.Color := $FFFFFF;
   Pen.Color := $FF00FF;
   Rectangle(0,0,Image1.Width,Image1.Height);
      case round of
   1: RoundRect(45,100,165,200,15,15);
   2: RoundRect(185,100,305,200,15,15);
   3: RoundRect(325,100,445,200,15,15);
   4: RoundRect(465,100,585,200,15,15);
   5: RoundRect(45,230,165,330,15,15);
   6: RoundRect(185,230,305,330,15,15);
   7: RoundRect(325,230,445,330,15,15);
   8: RoundRect(465,230,585,330,15,15);
  end;
 end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  malen(StrToInt(Edit1.Text));
end;

end.


Nicht richtig gelesen sorry.


Zuletzt bearbeitet von Blackheart666 am Mo 15.05.06 12:40, insgesamt 1-mal bearbeitet
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 15.05.06 11:18 
@Blackheart666. Was hast Du geändert :?:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
willy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Mo 15.05.06 13:54 
geht auch net...
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 15.05.06 15:55 
user profile iconwilly hat folgendes geschrieben:
geht auch net...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
with Image1.Canvas do
begin
  Brush.Color := clBtnFace;
  Pen.Color := clRed;
  Pen.Width := 1;
  Rectangle(0,0,Image1.Width,Image1.Height);
  Brush.Color := $FFFFFF;
  Pen.Color := $FF00FF;
  Pen.Width := 4;
  case FRound of
  1: RoundRect(45,100,165,200,15,15);
  2: RoundRect(185,100,305,200,15,15);
  3: RoundRect(325,100,445,200,15,15);
  4: RoundRect(465,100,585,200,15,15);
  5: RoundRect(45,230,165,330,15,15);
  6: RoundRect(185,230,305,330,15,15);
  7: RoundRect(325,230,445,330,15,15);
  8: RoundRect(465,230,585,330,15,15);
  end;
  Inc (FRound);
end;
geht einwandfrei :roll:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
willy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Mo 15.05.06 18:42 
bei mir jetzt auch vielen dank =)