Page 3 of 3

Re: Waveshare e-paper display how to rotate?

Posted: Sat Dec 23, 2023 10:45 am
by ernitron
???
Sorry but, I really couldn't understand this thread.
Rotating a frame buffer is as simple as (or I am missing something?):

Code: Select all

import framebuf

def bufrotate(fb, w, h, defaultcolor=1):
    rotatebuf = bytearray(w * h // 8)
    rotatefb = framebuf.FrameBuffer(rotatebuf, h, w, framebuf.MONO_HLSB)
    for x in range(h):
        for y in range(w):
             rotatefb.pixel(x,y, fb.pixel(w-1-y,x))
    return rotatebuf
Long time no see... what happened to this glorious forum? Did we really need to migrate the whole community on github? Just saying...