Skip to content

How can I use py5_tools.screenshot in class mode? #170

Answered by hx2A
zztkm asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, @zztkm! It seems like you've found a bug. Thank you for reporting this.

There are few things you can do differently. First, I recommend you use save_frame() instead of py5_tools.screenshot() here.

https://py5coding.org/reference/sketch_save_frame.html

I created py5_tools.screenshot() with the goal of providing an easy way for you to grab an arbitrary screenshot of a running sketch and have the image embedded in a Jupyter notebook. I should make it more clear in the documentation for py5_tools.screenshot() that save_frame() is also available and is a better choice for saving a frame from within a running Sketch.

Still, the code you wrote should work if hook_post_draw=False. The hook_po…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@hx2A
Comment options

Answer selected by zztkm
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@hx2A
Comment options

@zztkm
Comment options

@hx2A
Comment options

@zztkm
Comment options

@zztkm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants