Sign in to follow this  

D3DX.CreateTextureFromResourceEx

This topic is 4742 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, anyone out there familiar with the D3DX.CreateTextureFromResourceEx class, and how to properly use it? I am currently experiencing a problem with its use. I am using VB6 (I know... I know... but it works good for preliminary testing). Anyways, what I am trying to do is create a texture from a picturebox control. I then render this texture onto a primitive and use it in the main game loop. The benefits I derive from this is (would be) being able to manipulate the picturebox with simple vb commands (picture1.pset, picture1.print, etc.), and to modify textures on the fly... as in updating a health bar, creating dynamic animated text, etc. So far, I have this as my code: Set CharacterTexture = D3DX.CreateTextureFromResourceEx(D3DDevice, App.hInstance, "pic1", 0, 0, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, ARGB2LONG(255, 0, 0, 0), ByVal 0, ByVal 0) The app does not crash when this is executed, although err.description reports an automation error when this line is executed. Before this line is executed, the CharacterTexture is initialized and rendered with a different texture, which works fine, its only when I try to change the texture with this command that it fails to work. Any help is greatly appreciated, and thanks in advance. picsesmike

Share this post


Link to post
Share on other sites
OK, after a little studying, I have found I am using the wrong function. I have now made a VB Resource with the VB Resource Editor, which contains the bitmap. This is not what I had originally planned on, as a resource isn't as dynamic as the picturebox control I want to use. Although I created a resource and now use the "101" token to reference it, the code still does not work. Any help with creating a texture from a picturebox control would be greatly appreciated. For the time being I am going to continue learning more about VB Resources and see if I can't track down the current problem! Thanks, Mike

Share this post


Link to post
Share on other sites

This topic is 4742 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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