tstriker / hamster-experiments

Follow the link for documentation:
https://github.com/tstriker/hamster_experiments/wiki
GNU General Public License v2.0
61 stars 6 forks source link

grab screenshots? #19

Closed jedierikb closed 13 years ago

jedierikb commented 13 years ago

Is there an easy way to grab screenshots of hamsters?

tstriker commented 13 years ago

print screen button does it. but you can also get your hands on the context in on-enter-frame or even better on-finish-frame and paint it on a PNG surface

jedierikb commented 13 years ago

Could you post some code for how to do this? I am not clear on how to use the on-finish-frame context and pour it into another surface.

 self.on_finish_cb( self, emitter, ctx ):
      my_ctx = cairo.Context( self.my_own_cairo_surface )
      #....
      #I am doing something wrong.
tstriker commented 13 years ago

get the surface like this:

self.on_finish_frame(self, scene, context): surface = context.get_target()

# now use that surface to paint on another context (set_source_surface followed by paint)
jedierikb commented 13 years ago

yarp