• Advertisement
Sign in to follow this  

How to resize an image according to the size of a sprite in directx or slimdx

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

I want to know that is there any way of resizing our texture to the size of a sprite in slimdx direct3d9 or directx9. That is if my image size is 1024x768 and sprite size is 500x500, how can i resize the image in slimdx to display it fully on the sprite without any cropping.

Share this post


Link to post
Share on other sites
Advertisement
Make a standard quad or 2-triangle strip with UV coordinates:

[0,0]----[1,0]
| |
| |
[0,1]----[1,1]



Draw at:

[X,Y]-----------[X+500,Y]
| |
| |
[X,Y+500]----[X+500,Y+500]



L. Spiro

Share this post


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

  • Advertisement