SFML community forums

Help => Graphics => Topic started by: bluatigro on April 25, 2013, 10:39:29 am

Title: how do i save a [ part of ] a screen ?
Post by: bluatigro on April 25, 2013, 10:39:29 am


info : windowsXP / 7 SFML 1.6

i want to write my own spritemaker / anmationmaker
how do i save [ a part of ] a screen

have sprites a mask or a transparent-color-flag
or how do i create a sprite in code [ not from file ]
Title: Re: how do i save a [ part of ] a screen ?
Post by: Jebbs on April 26, 2013, 01:39:19 am
In SFML 1.6, getting the contents of the screen only works with a RenderWindow(just wanted to point that out).

You can do it two ways. The first way is through RenderWindow.Capture(), which will produce an Image with the entire screen's contents and then you can manipulate it through Image's methods.

You can also use Image.CopyScreen to save a portion(or all) of the window into an Image, and also manipulate it how you want through Image's methods.

Also, SFML 2.0 is going to be released in a couple of days so I would switch to that if you can!