Forum Archive

import local image to imageview

aidensala

is it possible to import a local image stored in the folder of my python and pyui scripts into the image view? i saw this was asked a couple years back but minimal info was given..

cvp

@aidensala try

import ui
iv = ui.ImageView()
iv.image = ui.Image.named('My image.jpg')
iv.present('sheet')
aidensala

heres the type error i get...
@cvp

traceback
typerror

cvp

@aidensala named instead of name

cvp

@aidensala Is it ok now? For info, name is an attribute giving the name of the object

aidensala

@cvp yep, thanks. i really appreciate the effort you put into helping this community.