I have a question about the right way to go about something, in general terms...
I have a large image (I can scale it to the width of the screen, but it will still be about twice the height of the screen). I would like to show just a part of the image that will fit on the screen, and then be able to scroll through the image to view different parts of it (using buttons or whatever).
But I am unsure of the best way to handle the displaying of the larger-than-screen-size image. I have it working now by creating a layer that is the width of the screen but twice the height of the screen, and then setting this Layer's image property to my image:
im = Image.open("bgnd.png").convert('RGBA')
w = int(self.bounds.w) # width of screen
h = int(im.size[1] * self.bounds.w / im.size[0]) # scale height keep aspect ratio
im = im.resize((w,h)) # scale image to fit screen width; image height > screen height
self.im_layer=Layer(Rect(0,0,w,h)) # this layer is larger than screen!
self.root_layer.add_layer(self.im_layer)
self.im_layer.image = load_pil_image(im)
This seems to work, but it feels wrong...
Is setting a Layer to be larger than the screen size OK to do? What does Pythonista do with the portion of the image that is off screen? Could this be problematic if the image were larger, say 10x the height of the screen? How should this issue -- scrolling through a image larger than the screen -- be handled in applications and on the pythonista platform in particular?