omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Custom Image for a Imageview?

    Pythonista
    3
    6
    1524
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RocketBlaster05
      RocketBlaster05 last edited by RocketBlaster05

      Can anybody tell me how to put a custom picture in an image view? Here is what I have:

      #in a class already under self
      self.mm = ui.load_view('MainMenu')
      img = ui.Image.named('companylogo.PNG')
      self.mm['imageview1'].image = img
      self.mm.present('fullscreen', hide_title_bar=True)
      #all of the presenting goes to the plan but the image doesn't appear and no errors pop up
      
      cvp 1 Reply Last reply Reply Quote 0
      • satsuki.kojima
        satsuki.kojima last edited by

        @RocketBlaster05:
        instead of,
        img = ui.Image.named('companylogo.PNG')
        try :
        img = ui.Image('companylogo.PNG')

        I think that would work.

        RocketBlaster05 1 Reply Last reply Reply Quote 1
        • cvp
          cvp @RocketBlaster05 last edited by cvp

          @RocketBlaster05 sure that the image is in the same folder? Try with

          img = ui.Image.named('iob:map_32')
          
          1 Reply Last reply Reply Quote 0
          • RocketBlaster05
            RocketBlaster05 @satsuki.kojima last edited by

            @satsuki.kojima It’s now telling me that it can’t load the image... is the image too large or am I missing something? @cvp

            1 Reply Last reply Reply Quote 0
            • RocketBlaster05
              RocketBlaster05 last edited by

              Ah ok fixed the problem. File was saved as .png but it needed to be .PNG

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @RocketBlaster05 last edited by

                @RocketBlaster05 👍 (thus the image was not in your folder 😂)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors