Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Saving resized images  (Read 1056 times)

0 Members and 1 Guest are viewing this topic.

Redemption

  • Newbie
  • *
  • Posts: 4
    • View Profile
Saving resized images
« 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!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Saving resized images
« Reply #1 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.
Laurent Gomila - SFML developer