Skip to content

Changing image size for layers 1-8 #3

@ColbyAttack

Description

@ColbyAttack

Hey!

Trying to replace some of the images with different full size images.

Made these changes and it seems to be building the dfu correctly, but it basically blanks the entire device when flashed to it. Any ideas?

# ================================= INIT ================================ #

def __init__(self):
    self.root = Tk()
    self.root.title("IED LCD Editor 0.9 - By LuX")
    self.root.resizable(0, 0)

    # =================================== Load images to black-white format
    for n in range(0, 8):
        try:
            in_image[n] = Image.open("F{0}.bmp".format(n)).convert("1")
        except:
            msgBox("Error loading image 'F{0}.bmp'\nThe app will now close".format(n), "File not found", 0)
            exit(1)

    # if not in_image[n].width == 128 - 96 * min(1, n) or not in_image[n].height == 32:
    #       msgBox("Image 'F{0}.bmp' is of wrong size\nShould be:  {1} x 32\nImage is:  {2} x {3}\nThe app will now close".format(n, 128 - 96 * min(1, n), in_image[n].width, in_image[n].height), "Wrong size", 0)
            exit(1)

    # =========================== Transform images into LCD acceptable data
    image_data[0] = [0] * 4 * 128
    for i in range(1, 8):
        image_data[i] = [0] * 4 * 128

    for i in range(0, 8):
        imgwidth = in_image[i].width
        for p in range(0, 4):
            for y in range(0, 8):
                for x in range(0, imgwidth):
                    if in_image[i].getpixel((x, (3-p)*8 + 7-y)) == 0:
                        image_data[i][p*imgwidth + x] |= (1 << y)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions