Jump to content
  • Advertisement
Sign in to follow this  
neviton

[.net] Texture.FromBitmap Problems

This topic is 5102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
My MaxTextureWidth = 2048 and MaxTextureHeight=2048.

If I load textures with TextureLoader.FromFile it works fine.

The problem happens just using Texture.FromBitmap.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!