Sign in to follow this  
Kapoef

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

Recommended Posts

Kapoef    115
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
SIIYA    477
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

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