D3DX.CreateTextureFromResourceEx

Started by
0 comments, last by PicsesMike 19 years, 4 months ago
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
Advertisement
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

This topic is closed to new replies.

Advertisement