Autor Beitrag
Andreas_Sans
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Fr 14.05.04 14:25 
Mit folgendem Code will ich das ein Bild gezeichnet wird :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm4.FormCreate(Sender: TObject);
begin
  if not dxdraw1.candraw then
  exit;
  dximagelist1.items[0].draw(dxdraw1.surface, 0, 0, 0);
  dxdraw1.flip;
end;

die imagelist ist mit der dxdraw-komponente verbunden, aber ich bekomme nur ein schwarzes bild. wenn ich das mit OnClick versuche dann wird das bild gezeichnet. Liegt das am OnCreate und wie kann man das umgehen ?

mfg Andreas
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Fr 14.05.04 15:14 
Schreib den Code mal ins OnInitialize Event des DXDraws, du versuchst schon draufzuzeichnen wenn es noch nicht initialisiert ist.

mfg
René

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Andreas_Sans Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Fr 14.05.04 15:57 
ich habs in OnInitialize probiert, aber da hat es auch nicht geklappt. dann habe ich es in OnRestoresurface probiert und siehe da es hat funktioniert.
umpani
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 389



BeitragVerfasst: Fr 14.05.04 16:02 
Diese Problem habe ich auch gehabt.

Glöst habe ich es mit eiem dxtimer.

Damit hat es funktioniert. ALso einfach deine Zeichenfunktion in die Timerauslösung und er zeichnet. warum auch immer.

Gruß Umpani

_________________
Lernen, ohne zu denken, ist eitel; denken, ohne zu lernen, ist gefährlich. Konfuzius
Andreas_Sans Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Fr 14.05.04 16:04 
das mit dem Timer hab ihc mir auch überlegt, aber ich wollte nicht extra einen timer benutzen für das Problem. danke für alle vorschläge