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.


    Imageview not updating to image from picker

    Pythonista
    2
    11
    3703
    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.
    • robertiii
      robertiii last edited by

      I cannot get the imageview to update. Not sure exactly how to use this, but here’s the code.

      image = photos.pick_asset(multi=False)
      
      img = image.get_ui_image()
      
      imageView = ui.ImageView('image')
      
      imageView.image = img
      
      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        It looks like the image is set correctly, but you're never actually showing the image view. Add something like imageView.present() at the end.

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

          I did present. And it caused the image to show in the console or something not in the view

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

            @robertiii Are you sure that you used imageView.present() and not img.show()?

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

              Yes. It only shows a pop-up with the photo

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

                Okay, and what did you expect?

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

                  How do I select an imageView in a pyui. That may be the problem

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

                    Can you be a bit more specific? I'm not sure what exactly you're talking about.

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

                      I have an imageView on the pyui. Whenever I say present it presents in full screen not to the imageView. How do i set the imageView to display the image rather than showing the sheet or full screen.

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

                        Okay, so you have a .pyui file that you load via ui.load_view, right? load_view returns the "main" view that was loaded. The image view you created in the UI editor has a "name" (by default something like 'imageview1') that you can set in the inspector panel.

                        You can access subviews of the "main" view using subscript notation, like this:

                        # ...
                        # img = ...
                        v = ui.load_view('myui.pyui')
                        img_view = v['imageview1']
                        img_view.image = img
                        
                        1 Reply Last reply Reply Quote 0
                        • robertiii
                          robertiii last edited by

                          I figured it out though I’m not exactly sure what I did differently! Thanks! Next question....any way of playing video?

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