[Si...] Posted April 7, 2025 Share Posted April 7, 2025 Dear, I have created poxplots in matplotlib to show in a dialog in Zeiss Inspect V23. The poxplots are properly generated and do exist (see below) however when I want to show them in a Inspect dialog using the code suggested under "https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/faq/faq.html#how-can-i-use-an-image-from-a-script-resource-file-in-a-user-defined-dialog". I get an error message that the resources cannot be found (see below). What's wrong? Does the resources have to be saved in a specific folder to be used in the dialog? Thanks for you help Link to comment Share on other sites More sharing options...
[Ma...] Posted April 8, 2025 Share Posted April 8, 2025 (edited) Hi, the FAQ article you mentioned shows how to use an image file embedded in an App via `gom.app.resource`. To display an image from an regular file, you can just read it into a variable: import gom if __name__ == '__main__': with open("C:/Temp/example.png", "rb") as f: image = f.read() DIALOG=gom.script.sys.create_user_defined_dialog (file='dialog.gdlg') DIALOG.image.data = image gom.script.sys.show_user_defined_dialog (dialog=DIALOG) Best regards, Matthias Edited April 8, 2025 Link to comment Share on other sites More sharing options...
[Si...] Posted April 8, 2025 Author Share Posted April 8, 2025 Thank you Matthias! That worked and solved the problem. With kind regards, Simon Link to comment Share on other sites More sharing options...
[Ma...] Posted April 9, 2025 Share Posted April 9, 2025 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in