Tricks with D3DX10GetImageInfoFromResource

I am playing with D3D10 tonight, and I am trying to get D3DX10GetImageInfoFromResource to work for me. I have beaten on it for a long time, and it still resists my powers.

On a whim I write some code to call FindResource myself to make sure that I can find the resource and it works, but that makes me think about the resource types on this page:

And then I remember that some other D3D resource functions like resources to be in RC_RCDATA format. Lo and behold, this is the problem - I had a bmp file as a resource, but it was marked with RC_BITMAP!

Lesson learned - D3D loads RC_RCDATA resources, even when they are bitmaps. I hope this saves somebody some time one day 🙂

Comments (4)

  1. Anonymous says:

    Yep.  Most things that load resources have some specific list of types they support.  It’s not always clear what those types are from the documentation, unfortunately.

    For example, IE’s res:// protocol only supports RT_HTML or RT_FILE.  I spent a few hours debugging the same thing to discover that.  🙂

  2. Anonymous says:

    A great many thanks!

    I spent hours on this. I thought I had created a bitmap in RC_RCDATA using the bitmap import  button and never saw that it created an RC_BITMAP resource. After reading your comments I went back and noticed where it was located. Now it works!!!

    Thanks again,

    Paul Roussin

  3. Anonymous says:

    Thanks a lot!



Skip to main content