standardize display() method

This commit is contained in:
txoof 2023-02-16 21:42:32 +01:00
parent 140a468ef7
commit b5d2818ea2
2 changed files with 4 additions and 4 deletions

View File

@ -43,13 +43,13 @@ try:
draw.chord((24, 4, 96, 76), 0, 360, fill = 255)
draw.line((20, 0, 100, 80), fill = 0)
draw.line((20, 80, 100, 0), fill = 0)
epd.Display(epd.getbuffer(image))
epd.display(epd.getbuffer(image))
time.sleep(2)
# read bmp file
logging.info("2.read bmp file...")
image = Image.open(os.path.join(picdir, '1in02.bmp'))
epd.Display(epd.getbuffer(image))
epd.display(epd.getbuffer(image))
time.sleep(2)
# read bmp file on window
@ -57,7 +57,7 @@ try:
image1 = Image.new('1', (epd.width, epd.height), 255) # 255: clear the frame
bmp = Image.open(os.path.join(picdir, '100x100.bmp'))
image1.paste(bmp, (0,0))
epd.Display(epd.getbuffer(image1))
epd.display(epd.getbuffer(image1))
time.sleep(2)
# # partial update

View File

@ -260,7 +260,7 @@ class EPD:
buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8))
return buf
def Display(self, image):
def display(self, image):
if (image == None):
return
# Width = (self.width % 8 == 0)? (self.width / 8 ): (self.width / 8 + 1)