Ogre Image class

rosenkro

20-11-2006 22:34:37

Hi bekas,

I've a little problem with the loadDynamicImage method of Mogre.Image

It requires a uchar* as first parameter, but VB.NET can't handle this and the method is not visible and not usable :-( Can you overload it with a byte array or something else for using it with VB.NET?

Roland

Bekas

21-11-2006 13:09:07

Use the LoadRawData method which is more flexible; you'll be able to pass any kind of System.IO.Stream:
Dim buffer() As Byte = GetImageData()
Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream(buffer)
Dim mds As Mogre.ManagedDataStream = New Mogre.ManagedDataStream(ms)
Dim dsptr As Mogre.DataStreamPtr = New Mogre.DataStreamPtr(mds)

Dim img As Mogre.Image = New Mogre.Image()
img.LoadRawData(dsptr, width, height, Format)

dsptr.Dispose()

rosenkro

21-11-2006 15:24:06

Ups :-) Yes... I was converting a c++ ogre example to vb.net. There was loadDynamicImage used... But loadRawData works fine, too :-)

Thanks...

Roland