Jump to content

  • Log In with Google      Sign In   
  • Create Account

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


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1   Members   

100
Like
0Likes
Like

Posted 01 October 2011 - 01:43 AM

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.

#2   Members   

24838
Like
1Likes
Like

Posted 01 October 2011 - 01:50 AM

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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.