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
-
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
-
-
it seems here that your problem simply may be that you are calling the image
board
in one spot, andself.board
in another!self.board
in both places will avoid issues with scope.