Jump to content

  • Log In with Google      Sign In   
  • Create Account

Resizing image with xna


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
3 replies to this topic

#1 MisteRnoOrOnha   Members   -  Reputation: 241

Like
0Likes
Like

Posted 25 January 2013 - 07:15 AM

Hi ladies and gentlemans, now i'm here do ask how can i resize an image in XNA without lose quality? I'm use the draw method but the image appears on screen with a giant blur, how can i remove this?



Sponsor:

#2 phil_t   Crossbones+   -  Reputation: 4092

Like
0Likes
Like

Posted 25 January 2013 - 07:19 AM

Are you making the image bigger or smaller?

How are you drawing the image?

What SamplerState are you using?

 

Edit: If you're trying to enlarge a small image and keep sharp pixel edges, you need to use point sampling. (SamplerState.PointClamp or SamplerState.PointWrap).


Edited by phil_t, 25 January 2013 - 07:21 AM.


#3 MisteRnoOrOnha   Members   -  Reputation: 241

Like
0Likes
Like

Posted 25 January 2013 - 11:06 AM

How i use the SamplerState.PointClamp?



#4 Havsmonstret   Members   -  Reputation: 464

Like
0Likes
Like

Posted 25 January 2013 - 11:39 AM

How i use the SamplerState.PointClamp?


You set it in the Begin method of your SpriteBatch (the third argument):
http://msdn.microsoft.com/en-us/library/ff433699.aspx

Edited by Navall, 25 January 2013 - 11:39 AM.





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.



PARTNERS