Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Problems with ui.imageview
-
Hi,
I have some trouble with ui.imageview. Trying to set an image I cannot display images from 'My Images'. Choosing an image from Emojis or Test Images works fine.
view['imageview1'].image = ui.Image.named('_Mauzi')
Some hints?
Regards
Tom -
The "My Images" feature is mostly intended for use with the
scene
module, and to be honest, I haven't really touched it since version 1.0 – I'd really like to replace it with something better...
Anyway, you can use it with theui
module like this:view['imageview1'].image = ui.Image.named('Images/_Mauzi.png')
This only works if your script is in the root folder of the script library. If that's not the case, try something like this:
import os images_root = os.path.expanduser('~/Documents/Images') image_name = '_Mauzi' image_path = os.path.join(images_root, image_name + '.png') view['imageview1'].image = ui.Image.named(image_path))
-
Many thanks, now it works fine.