Accessing Direct3D Texture Dimensions in C#
Is there any way to get the width and height of a Direct3D texture in C#? I know you can do it in C++ by using the D3DXCreateTextureFromFileEX function and passing in a pointer to a D3DXIMAGE_INFO struct to the function. Any thoughts?
Thanks,
Also, TextureLoader has an overloaded FromFile() method that takes an ImageInformation structure that gets filled in like the D3DXIMAGE_INFO structure.
Note that Evil Steve's remark also applies here. If you load a 200x200 image into a texture, the actual texture size will probably be 256x256. To get this texture size, you can use the Width and Height in the surface description of the first MIP level:
SurfaceDescription sd = texture.GetLevelDescription(0);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement