1- from imgui_bundle import immvision , immapp , imgui_md , ImVec2
1+ from imgui_bundle import immvision , immapp , imgui_md , ImVec2 , imgui , hello_imgui
22from imgui_bundle .demos_python import demo_utils
33
44immvision .use_rgb_color_order ()
@@ -16,19 +16,31 @@ def demo_gui() -> None:
1616 statics .tennis = demo_utils .imread_pil (assets_dir + "tennis.jpg" )
1717
1818 statics .params = immvision .ImageParams ()
19+ bear_display_size = int (hello_imgui .em_size (15 ))
20+ statics .params .image_display_size = (bear_display_size , bear_display_size )
1921 statics .inited = True
2022
21- imgui_md .render_unindented ("immvision.image_display() will simply display an image" )
23+ imgui .begin_group ()
24+ imgui_md .render_unindented ("# immvision.image_display()" )
25+ imgui_md .render_unindented ("Displays an image (possibly resizable)" )
2226 immvision .image_display_resizable (
2327 "Tennis" , statics .tennis , size = statics .image_display_size
2428 )
29+ imgui .end_group ()
2530
26- imgui_md . render_unindented (
27- """
28- immvision.image() will display an image, while providing lots of visualization options.<br>
29- Open the options panel by clicking on the settings button at the bottom right corner of the image"""
30- )
31+ imgui . same_line ()
32+
33+ imgui . begin_group ()
34+ imgui_md . render_unindented ( "# immvision. image()" )
35+ imgui_md . render_unindented ( "Displays an image, while providing lots of visualization options." )
3136 immvision .image ("Bear" , statics .bear , statics .params )
37+ imgui_md .render_unindented ("""
38+ * Zoom in/out using the mouse wheel.
39+ * Pixel values are displayed at high zoom levels.
40+ * Pan the image by dragging it with the left mouse button
41+ * Open settings via button (bottom right corner of the image)
42+ """ )
43+ imgui .end_group ()
3244
3345
3446def main ():
0 commit comments