hello! i’m working on app and i want to add an image , but i can’t i used this functions : add_static_texture() | add_image()
After running this application which is written by console:
Traceback (most recent call last): File "D:\Games\apps\app1\app.py", line 48, in <module> texture_id = dpg.add_static_texture(width, height, image_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\d info\AppData\Roaming\Python\Python311\site-packages\dearpygui\dearpygui.py", line 7023, in add_static_texture return internal_dpg.add_static_texture(width, height, default_value, label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, parent=parent, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SystemError: <built-in function add_static_texture> returned a result with an exception set
and this is script:
image_path = "1032.png"
width, height = 512, 512
with open(image_path, "rb") as f:
image_data = f.read()
with dpg.handler_registry():
texture_id = dpg.add_static_texture(width, height, image_data)
with dpg.handler_registry():
dpg.add_image(texture_id, width=512, height=512)