pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
590 stars 122 forks source link

wHat: 90 degree rotation #142

Closed wisemoth closed 1 year ago

wisemoth commented 2 years ago

I can set self.rotation to be 0 and 180 without issue.

However if I set to 90 or 270 the display is garbled. It looks like there is library code to support 90 degree rotation, but am I expected to flip width and height in my own code or? Are there examples?

gleich commented 2 years ago

I am having the same issue with the phat. @wisemoth did you do anything to fix this?

wisemoth commented 2 years ago

@gleich I'm afraid not - I ended up drawing the UI in landscape mode, but would still prefer to run in portrait mode if that became possible.

Gadgetoid commented 2 years ago

Inky just uses a Pillow Image to draw the UI, you can draw into a portrait image and rotate that to landscape before sending it to display.set_image()

IE:

from PIL import Image

img = Image.new("P", (300, 400))

inky.set_image(img.rotate(90, expand=True))