Skip to content

Commit

Permalink
main : take screenshot example
Browse files Browse the repository at this point in the history
  • Loading branch information
my1e5 committed May 10, 2023
1 parent 54fb9ac commit 3721b25
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions misc/take_screenshot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://discord.com/channels/736279277242417272/1105417341560438844/1105420268287033375
import dearpygui.dearpygui as dpg
dpg.create_context()

def dpg_screenshot():
dpg.output_frame_buffer('screenshot.png')

with dpg.window(width=200, height=200):
dpg.add_button(label='Screenshot', callback=dpg_screenshot)

dpg.create_viewport(width=400, height=400)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

0 comments on commit 3721b25

Please sign in to comment.