.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/07_ui/viz_drawpanel.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_07_ui_viz_drawpanel.py: ========= DrawPanel ========= This example shows how to use the DrawPanel UI. We will demonstrate how to create Various shapes and transform them. First, some imports. .. GENERATED FROM PYTHON SOURCE LINES 11-15 .. code-block:: Python from fury import ui, window from fury.data import fetch_viz_new_icons .. GENERATED FROM PYTHON SOURCE LINES 16-17 First we need to fetch some icons that are needed for DrawPanel. .. GENERATED FROM PYTHON SOURCE LINES 17-20 .. code-block:: Python fetch_viz_new_icons() .. GENERATED FROM PYTHON SOURCE LINES 21-22 We then create a DrawPanel Object. .. GENERATED FROM PYTHON SOURCE LINES 22-25 .. code-block:: Python drawing_canvas = ui.DrawPanel(size=(560, 560), position=(40, 10)) .. GENERATED FROM PYTHON SOURCE LINES 26-30 Show Manager ============ Now we add DrawPanel to the scene. .. GENERATED FROM PYTHON SOURCE LINES 30-47 .. code-block:: Python current_size = (650, 650) showm = window.ShowManager(size=current_size, title="DrawPanel UI Example") showm.scene.add(drawing_canvas) interactive = False if interactive: showm.start() else: # If the UI isn't interactive, then adding a circle to the canvas drawing_canvas.current_mode = "circle" drawing_canvas.draw_shape(shape_type="circle", current_position=(275, 275)) drawing_canvas.shape_list[-1].resize((50, 50)) window.record(showm.scene, size=current_size, out_path="viz_drawpanel.png") .. _sphx_glr_download_auto_examples_07_ui_viz_drawpanel.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: viz_drawpanel.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: viz_drawpanel.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_