liulhack
06-22-2008, 12:32 AM
I want to use CreateTextureFromFileInMemory() to load a picture data.
so I do it like this:
---------------------------------
Dim tex as Direct3Dtexture8,data() as Byte,size as long
dim fn as long
…… ……
fn=FreeFile
open "test.png" for Binary as #fn
size=LOF(fn)
redim data(size-1)
Get #fn,,data()
Close #fn
set tex=m_D3dx.CreateTextureFromFileInMemory(m_Dev,data(0),size)
'But the line which includes CreateTextureFromFileInMemory tells me Automation-error
'please tell me why I am wrong and how to do it with vb6
so I do it like this:
---------------------------------
Dim tex as Direct3Dtexture8,data() as Byte,size as long
dim fn as long
…… ……
fn=FreeFile
open "test.png" for Binary as #fn
size=LOF(fn)
redim data(size-1)
Get #fn,,data()
Close #fn
set tex=m_D3dx.CreateTextureFromFileInMemory(m_Dev,data(0),size)
'But the line which includes CreateTextureFromFileInMemory tells me Automation-error
'please tell me why I am wrong and how to do it with vb6