Transparent Texture from Resource File DirectX8

jamesw1024 used Ask the Experts™
Hi,  I'm using createtexturefromfileex in VB6 to create textures from bitmaps in Driectx 8. However I want to combine all of my images into a single resource file.  When I run createtexturefromresourxeex to load it in I get error code D3DXERR_INVALIDDATA.  The parmaters are identical as to the create from file apart from passing App.hInstance and the resource number e.g. "101" for string.

Any help would be much appreciated as I'm stumped.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I think you are confusing two things: Loading from a bitmap resource and loading a file specified by a string resource. I might be wrong, and if so I would appreciate clearification of your problem. If, on the other hand, this assumption is right you would still need to call CreateTextureFromFile but call LoadString, specifying the string resource identifier. If I did misinterpret your question feel free to set it straight.



Thanks, I just happened to stumble across the solution.  When loading textures from a resource file, you are expected to pass app.hinstance.  This only works when the App is compiled.

thanks for your help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial