Hi,
I am trying to do some graphics with Direct3D for Windows Mobile.
Everything works fine until I create a texture:
texture = TextureLoader.FromFile(dev, "My Documents\\abc.bmp", 200, 200, 0, Usage.None, Format.A8R8G8B8,Pool.Managed,
Filter.None, Filter.None, 0);
This throws the InvalidOperationException with no further details how to solve it.
The alternative ways to create a texture lead to the same exception:
texture = TextureLoader.FromStream(dev,
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Project1.abc.bmp"));
texture = TextureLoader.FromFile(dev,"Project1.abc.bmp");
Could someone help me with this please?
I would very appreciate any advice!!!
Thank you,
Katerina
Posted May 3, 2008, 7:04 AM
Hi first of all i think you have to give the full path name for the texture to load,
if you add the @ charecter before a string you can use single \
eg: @"c:\windows\test.bmp"
When loading the texture use the unknown format, that way, the system gets the format from the file instead. Certain bitmap formats cannot be loaded differently.
texture = TextureLoader.FromFile(dev, @"c:\My Documents\abc.bmp", 200, 200, 0, Usage.None, Format.unknown ,Pool.Managed, Filter.None, Filter.None, 0);
it maybe just a simple thing like the file doesn't exist at that location, but i guess you've already tried that.
Hope that helps
Leade