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.


    Load image problem

    Pythonista
    3
    3
    2307
    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.
    • Kluesi
      Kluesi last edited by

      Hi

      I load an image on Class Definition:

      ---SNIP---
      Class XYZ (Scene)
      board=load_image_file('animage.jpg')
      ...

      def draw(self):
      image(self.board,1,1,426,320)
      ---SNIP---

      Here I get a white rect, but no image. I also tried to load the image in "def setup(self):" but I get the same white rect. Only if I load the image directly in the draw procedure just before the image(...) then I get the image.

      But is this the right way. I think this draw procedure runs 60 times a second. And so I also load this image 60 times.

      How do I load the image the right way.

      Thanks Jens

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

        Pythonista 1.5 example

        1 Reply Last reply Reply Quote 1
        • JonB
          JonB last edited by

          it seems here that your problem simply may be that you are calling the image board in one spot, and self.board in another! self.board in both places will avoid issues with scope.

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