SFML community forums
Help => General => Topic started by: Birdron on December 06, 2019, 11:47:17 pm
-
Hi,
There is a method RenderWindow::capture which save all window as an image. Is it possible to save just those images which are inside a rectangleShape?
I have attached an image, I just want to save the inner area. Which is a rectangleShape.
Thank you
-
capture() is deprecated, instead you should be using texture.update(window) and then texture.copyToImage().
As for your question, not that's not directly supported. You can do it by either rendering to a render texture only the part you want to save, or you could only save a section of the sf::Image (e.g. use image.copy() and then save the copied image).