Welcome to MSDN Blogs Sign in | Join | Help

BenCon's WebLog

D2D development blog
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:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/WindowsUserInterface/Resources/IntroductiontoResources/resourcereference/resourcetypes.asp

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 :)

Posted: Thursday, March 29, 2007 9:56 PM by BenCon
Filed under:

Comments

jeffdav said:

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.  :)

# April 2, 2007 11:18 AM

Paul Roussin said:

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

# May 26, 2007 1:39 PM

Morpheus said:

I wasn't aware about this :(

-Morpheus

http://wpfcontrols.blogspot.com

# October 10, 2007 2:46 PM

Stefan said:

Thanks a lot!

Cheers,

Stefan

# November 11, 2008 4:36 AM
New Comments to this post are disabled
Page view tracker