Autor Beitrag
GuaAck
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 376
Erhaltene Danke: 32

Windows 8.1
Delphi 10.4 Comm. Edition
BeitragVerfasst: So 23.09.12 00:25 
Hallo Experten,

ich habe bisher Texturen (DirectX 9) immer aus *.BMP-Files geladen. Jetzt möchte ich aber zur Laufzeit eine Textur erzeugen. Ich nehme eine TBitmap, und erzeuge mein Textur-Muster. Zwar kann ich die Bitmap in einem File speichern und dann mit D3DXCreateTextureFromFile laden, aber viel besser wäre ja etwas wie "...CreateTextureFromBitmap", das gibt es aber nicht.

Hätte da jemand einen Tipp?

Gruß
GuaAck
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: So 23.09.12 00:44 
ungetestet ...
ausblenden Delphi-Quelltext
1:
2:
  bmp.SaveToStream(str);
  D3DXCreateTextureFromFileInMemory(D3DDev9,str.Memory,str.Size,Textures[0].Pic);

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS

Für diesen Beitrag haben gedankt: GuaAck
GuaAck Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 376
Erhaltene Danke: 32

Windows 8.1
Delphi 10.4 Comm. Edition
BeitragVerfasst: So 23.09.12 19:31 
Danke,

so geht es gut, (str: TMemorystream)!!
Das .pic muss aber weg.

Gruß GuaAck