ntotor
13-07-2008 12:15:19
Hello,
In first time sorry for my poor English ...
I'm trying to load a Bitmap using this code :
pbm 1 generate an error :
OGRE EXCEPTION(7:InternalErrorException): Error decoding image in FreeImageCodec::decode at ..\src\OgreFreeImageCodec.cpp (line 343)
pbm 2 generate an other error :
OGRE EXCEPTION(2:InvalidParametersException): Stream size does not match calculated image size in Image::loadRawData at ..\src\OgreImage.cpp (line 286)
Someone could say where i'm wrong ?
Thanks a lot.
In first time sorry for my poor English ...
I'm trying to load a Bitmap using this code :
// Image_Source is a System.Drawing.Bitmap
// Image_Source.PixelFormat = Format24bppRgb
System.IO.MemoryStream Str_Data = new System.IO.MemoryStream();
Image_Source.Save(Str_Data, System.Drawing.Imaging.ImageFormat.Png);
Mogre.ManagedDataStream mds = new Mogre.ManagedDataStream(Str_Data);
Mogre.DataStreamPtr dsptr = new Mogre.DataStreamPtr(mds);
Mogre.Image img = new Mogre.Image();
// --> pbm 1
img.Load(dsptr, "png");
OR
// --> pbm 2
img.LoadRawData(dsptr, (uint)Image_Source.Width , (uint)Image_Source.Height, Mogre.PixelFormat.PF_R8G8B8);
pbm 1 generate an error :
OGRE EXCEPTION(7:InternalErrorException): Error decoding image in FreeImageCodec::decode at ..\src\OgreFreeImageCodec.cpp (line 343)
pbm 2 generate an other error :
OGRE EXCEPTION(2:InvalidParametersException): Stream size does not match calculated image size in Image::loadRawData at ..\src\OgreImage.cpp (line 286)
Someone could say where i'm wrong ?
Thanks a lot.