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

Author Topic: how do i save a [ part of ] a screen ?  (Read 1026 times)

0 Members and 1 Guest are viewing this topic.

bluatigro

  • Newbie
  • *
  • Posts: 4
    • View Profile
how do i save a [ part of ] a screen ?
« 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 ]
cxiu diferas el tio respondas cxiu samvaloras
[ esperanto : everybody is diferent therefore everybody is equal ]

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: how do i save a [ part of ] a screen ?
« Reply #1 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!
DSFML - SFML for the D Programming Language.