Autor Beitrag
kkirk
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Fr 29.06.07 13:06 
Hallo,

kann mir einer weiterhelfen und mir zeigen,
wie man mit OpenGL in einer TImage zeichnen kann.
Probleme gibts beim zuweisen des Handles. ->???
Hier mein Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
  DC : HDC;   // Handle auf Zeichenfläche
  RC : HGLRC; // Rendering Context
  .
  .
  .

  DC:= Image1.Picture.Bitmap.Canvas.Handle;
  if not InitOpenGL then Application.Terminate;
  RC:= CreateRenderingContext( DC,
                               [opDoubleBuffered],
                               32,
                               24,
                               0,0,0,
                               0);
  ActivateRenderingContext(DC, RC);


Moderiert von user profile iconmatze: Delphi-Tags hinzugefügt
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 29.06.07 13:18 
Da fehlt das GetDC.
Aber in ein Bitmap zu rendern ist sicherlich keinegute Idee...
Render lieber auf ein Panel.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
kkirk Threadstarter
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Fr 29.06.07 13:47 
GETDC klappt auch nicht!
Delphi sagt dann:" Das Handle ist ungültig) ->???

Das TImage muss ich aber nehmen, weil es schon im Projekt vorhanden ist und ich eine kl. Figur transparent drüberzeichnen muss.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 29.06.07 14:18 
Du brauchst aber ein Window-Handle und kein Canvas-Handle.
So geht das nicht, entweder Ogl oder mit Bitmaps rumbasteln.
Transparenz geht aber auch mit Canvas (etc.), aber halt nix halbtransparentes.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.