![]() |
Re: Canvas zeichnet bei Integer, nicht bei Single
Zitat:
Zitat:
|
Re: Canvas zeichnet bei Integer, nicht bei Single
Zitat:
0/p ist Null. Oder was wolltest du damit sagen? |
Re: Canvas zeichnet bei Integer, nicht bei Single
Delphi-Quellcode:
procedure TFormPalettierung.SpeedButtonZeichnenClick(Sender: TObject);
var Breite, Hoehe : Integer; c,v,p : Single; begin Lv := StrToFloat (EditLaenge.Text); Bv := StrToFloat (EditBreite.Text); Hv := StrToFloat (EditHoehe.Text); repaint; if ComboBoxPalettenwahl.ItemIndex = 0 then Breite := 1200; if ComboBoxPalettenwahl.ItemIndex = 0 then Hoehe := 800; if ComboBoxPalettenwahl.ItemIndex = 1 then Breite := 1200; if ComboBoxPalettenwahl.Itemindex = 1 then Hoehe := 1000; imageDraufsicht.Canvas.rectangle(0,0, Breite div 5 , Hoehe div 5 ); begin repeat c:=c+1 until c+1 * Bv > Breite; if c+1 * Bv > Breite then c:= c-1; repeat v:=v+1 until v+1 * Lv > Hoehe; if v+1 * Lv > Hoehe then v:= v-1; end; while p<=c do begin imagedraufsicht.Canvas.MoveTo(round(p*Bv),0); imagedraufsicht.Canvas.LineTo(round(p*BV),round(v * Lv)); end; So, bei dieser Programmierung hängt sich das Programm beim zeichnen auf.... |
Re: Canvas zeichnet bei Integer, nicht bei Single
Hi,
In der while schleife müsste sich c oder p auch ändern. Tschüsss! |
Re: Canvas zeichnet bei Integer, nicht bei Single
anstatt der while eine repeat funktion??
repeat imagedraufsicht.Canvas.MoveTo(round((p+1)*Bv),0); imagedraufsicht.Canvas.LineTo(round((p+1)*BV),roun d(v * Lv)); until p+1=c ; |
Re: Canvas zeichnet bei Integer, nicht bei Single
Hi,
nein in der while schleife c+1 oder p-1 denn die Schleife wird so lange ausgeführt wie c<=p ist. Also so lange wie sich nichts ändert. Tschüsss! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:13 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz