def sendIconFor(self, function, icon, inverted=False, centered=True, marked=False, crossed=False):
    (x, y, w, h) = self.getAreaFor(function)
    img = Image.new('1', (w, h), color=(0 if inverted else 1))
    imgIcon = Image.open(icon).convert('RGB')
    if inverted:
        imgIcon = ImageOps.invert(imgIcon)
    (wi, hi) = imgIcon.size
    if (function < 6):
        pos = ((((w - wi) // 2) if centered else 0), ((h - hi) // 2))
    else:
        pos = ((((w - wi) // 2) if centered else (w - wi)), ((h - hi) // 2))
    img.paste(imgIcon, pos)
    if marked:
        imgMarker = Image.open(('icons/chevron-compact-right.png' if (function < 6) else 'icons/chevron-compact-left.png'))
        (wm, hm) = imgMarker.size
        img.paste(imgMarker, (((- 16), ((h - hm) // 2)) if (function < 6) else (((w - wm) + 16), ((h - hm) // 2))), mask=ImageOps.invert(imgMarker.convert('RGB')).convert('1'))
    if crossed:
        d = ImageDraw.Draw(img)
        d.line([(pos[0] + 5), (pos[1] + 5), ((pos[0] + wi) - 5), ((pos[1] + hi) - 5)], width=3)
        d.line([(pos[0] + 5), ((pos[1] + hi) - 5), ((pos[0] + wi) - 5), (pos[1] + 5)], width=3)
    self.sendImage(x, y, img)
def sendIconFor(self, function, icon, inverted=False, centered=True, marked=False, crossed=False):
    (x, y, w, h) = self.getAreaFor(function)
    img = Image.new('1', (w, h), color=(0 if inverted else 1))
    imgIcon = Image.open(icon).convert('RGB')
    if inverted:
        imgIcon = ImageOps.invert(imgIcon)
    (wi, hi) = imgIcon.size
    if (function < 6):
        pos = ((((w - wi) // 2) if centered else 0), ((h - hi) // 2))
    else:
        pos = ((((w - wi) // 2) if centered else (w - wi)), ((h - hi) // 2))
    img.paste(imgIcon, pos)
    if marked:
        imgMarker = Image.open(('icons/chevron-compact-right.png' if (function < 6) else 'icons/chevron-compact-left.png'))
        (wm, hm) = imgMarker.size
        img.paste(imgMarker, (((- 16), ((h - hm) // 2)) if (function < 6) else (((w - wm) + 16), ((h - hm) // 2))), mask=ImageOps.invert(imgMarker.convert('RGB')).convert('1'))
    if crossed:
        d = ImageDraw.Draw(img)
        d.line([(pos[0] + 5), (pos[1] + 5), ((pos[0] + wi) - 5), ((pos[1] + hi) - 5)], width=3)
        d.line([(pos[0] + 5), ((pos[1] + hi) - 5), ((pos[0] + wi) - 5), (pos[1] + 5)], width=3)
    self.sendImage(x, y, img)