Replies: 3 comments
-
Hi welcome! An example of displaying and resizing an image can be seen with the following app. Even though it's not shown in the GIF, the image resizes when the app is resized as well. I believe the following app uses PIL to create e-book covers and displays them in Dear PyGui afterwards. Check out the rest of the showcase gallery as well. There are some useful ideas in there! |
Beta Was this translation helpful? Give feedback.
-
Here is how you resize image in texture_registry. Code is setup with square image loaded. But you can change that with changing size parameters to width, height that is pulled from get_item_rect_size.
Using img from PIL library is basically just saving an image in PIL and loading it in DPG. |
Beta Was this translation helpful? Give feedback.
-
I know this is a quite late reply but there is a chance it will help someone ))) dpg.create_context() width, height, channels, data = dpg.load_image("joystick.png") dpg.create_viewport(title='Custom Title', width=700, height=400, resizable=True) while dpg.is_dearpygui_running(): |
Beta Was this translation helpful? Give feedback.
-
I am new to this and been messing with the demo for hours now. I want to know if it's possible to display an image from a file to a window that auto resizes itself (same aspect ratio) when its window is resized.
Also I want to know how to add texture from PIL.Image.
Beta Was this translation helpful? Give feedback.
All reactions