• Advertisement
Sign in to follow this  

How to create a new Texture from an existent Texture?

This topic is 4434 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

How to create a new Texture from an existent Texture I have a bitmap file, first I created a Texture from a bitmap file by using function D3DXCreateTextureFromFile(). Now I want to create an another Texture from the existent Texture, and the new Texture's content is the existent one's bitmap but be rotated 15 degrees. For Example: the existent Textures have a horizontal line "-" on it's center , from the old Textures I can create another three Textures by rotating different degrees, and the another Textures looks like "\", "|" or "/" . How to do this? I only want to create a series of sequential Textures from one Texture, not to rotate a point with Texture in 3D matrix. at last, the example I rotate a Texture bitmap around Z axis, if it can be work out,then how to do this around X axis or Y axis? Thanks:)

Share this post


Link to post
Share on other sites
Advertisement
I found some demos that rotate images:

CodeGuru demo
CodeProject demo

Now all you have to do is adapt those algorithms to operate on a texture's pixel data. If you have trouble locking textures, check out this KBase category. This part should be pretty straighfoward. Just create a blank texture of the same size and format as the loaded texture, and then run the rotation algorithm on the loaded texture, copying it into the blank one.

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
I found some demos that rotate images:
......



I will try it.

Thanks your help :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement