Jump to content
  • Advertisement
Sign in to follow this  
Kapoef

C++ DirectX9. Simple question- How to access texture data.

This topic is 3011 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

Hi I feel stupid asking this but I can't find to methods to extract data from a texture. I'm loading a texture from file into LPDIRECT3DTEXTURE9 using D3DXCreateTextureFromFile. Now what I would like to know is how do I get access to the actual *.bmp data? I need access to the bmp width, height, pixel colors etc... Is there any directx9 method to do this? Thx in advance

Share this post


Link to post
Share on other sites
Advertisement
Use D3DXCreateTextureFromFileEx() function and pass pointer to D3DXIMAGE_INFO structure to get texture width, height, depth, format etc...If you want to get pixel colors than lock the texture and read bytes you are interested in.

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!