Sign in to follow this  
neviton

[.net] Texture.FromBitmap Problems

Recommended Posts

I´m having problems when I try to load a texture from a Bitmap(GDI) using Texture.FromBitmap. If the dimentions is less then 512x512 its working fine, but if it is a little more, throw the message: "An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidCallException' occurred in microsoft.directx.direct3d.dll Additional information: Error in the application." My code: Bitmap bmpTexture = new Bitmap(imagePath+imageName); textures[imgIndex] = Texture.FromBitmap(device, bmpTexture, 0, Pool.Managed); Thanks

Share this post


Link to post
Share on other sites
Save the bitmap to disk or to a memory stream and try loading the texture from that. If that works it may be good enough, if not it may be a problem with the bitmap itself.

Have you tried using different pools?

Share this post


Link to post
Share on other sites
Thanx for the help, but now I´m getting another problem here:
When the dimentions of my texture are a little more then 512x512 the textures are blinking, take a look

(http://www.aplicativo.com.br/aplicativo/images/flicker.gif).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this