Autor Beitrag
Tigu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 93

XP
Delphi 7
BeitragVerfasst: Mo 03.04.06 15:49 
Hallo!

Ich muss ein Programm schreibe, welches eine Mauer zeichnet. Nun wolle ich delphi erst einmal nur die unterste Reihe zeichnen lassen.
Mein Problem liegt jetzt darin, dass ich mich zu doof anstelle, das erste Rechteck in der unteren linken Ecke einzeichnen zu lassen, weil delphi ja bekanntlich oben rechts anfängt.
Ist zwar eigentlich ein ziehmlich banahles Problem, ich stehe nur auf dem Schlauch, hoffe aber trotzdem, das mir jemand auf die Sprünge hilft.

Danke für die Hilfe
Tigu
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Mo 03.04.06 15:56 
Womit möchtest du es denn zeichnen. Mit Canvas?
Dann würde ich dir ein Image empfehlen, in die du dann zeichnest (damit das Bild net veschwindet, wenn du die Form z.B. vergrößerst).


Zuletzt bearbeitet von Danniolo am Mo 03.04.06 15:59, insgesamt 1-mal bearbeitet
Tigu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 93

XP
Delphi 7
BeitragVerfasst: Mo 03.04.06 15:58 
Ich wollte eigentlich ein normales Image nehmen.
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Mo 03.04.06 16:07 
Meint ich ja auch :roll:
Probier mal, ob folgender Code das erzeugt, was du haben willst :roll:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
const breite = 100;
var i: Integer;
begin
  Image1.Canvas.Rectangle(0,0,Image1.Width,Image1.Height);
  For i := 0 To 5 Do
  Begin
    With Image1.Canvas Do
      Rectangle(breite*i,Image1.Height-breite,breite*i+breite,Image1.height);
  End;
end;
Tigu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 93

XP
Delphi 7
BeitragVerfasst: Mo 03.04.06 16:10 
Super! :zustimm:
Danke.