SFML community forums

Help => Graphics => Topic started by: Redemption on October 09, 2012, 10:01:40 pm

Title: Saving resized images
Post by: Redemption on October 09, 2012, 10:01:40 pm
Hello,

I have a data set, which I convert to a sf::Image object, which I put into a sf::Sprite object, which I then scale, and finally display. What I need to do is save this final, scaled image to a file.

I see that the sf::Image object has a "saveToFile" function, but this will save the original image and not the scaled one. My question is, is there a way to:

a) save the scaled sprite to a file?
b) scale the actual Image object, instead of just the sprite?

Thanks!
Title: Re: Saving resized images
Post by: Laurent on October 09, 2012, 10:42:56 pm
With SFML 2 you can draw to a sf::RenderTexture, and then save it back to a sf::Image and then to a file.