diff --git a/photobox.py b/photobox.py index 4cdaf3b..bb7f322 100755 --- a/photobox.py +++ b/photobox.py @@ -122,33 +122,31 @@ screen = pygame.display.set_mode((WIDTH,HEIGHT)) # LOAD OVERLAYS -loading = pygame.image.load(GRAPHICS_DIR + "/loading.png") +begin = pygame.image.load(GRAPHICS_DIR + "/begin.png") +begin_rect = begin.get_rect() + +loading = pygame.image.load(GRAPHICS_DIR + "/loading.png") loading_rect = loading.get_rect() -begin = pygame.image.load(GRAPHICS_DIR + "/begin.png") -begin_rect = begin.get_rect() - -yes = pygame.image.load(GRAPHICS_DIR + "/yes.png") +yes = pygame.image.load(GRAPHICS_DIR + "/yes.png") yes_rect = yes.get_rect() -yes_rect.y = 340 +yes_rect.y = 340 -no = pygame.image.load(GRAPHICS_DIR + "/no.png") -no_rect = no.get_rect() -no_rect.y = 340 +no = pygame.image.load(GRAPHICS_DIR + "/no.png") +no_rect = no.get_rect() +no_rect.y = 340 -end_yes = pygame.image.load(GRAPHICS_DIR + "/end_yes.png") +end_yes = pygame.image.load(GRAPHICS_DIR + "/end_yes.png") end_yes_rect = end_yes.get_rect() -end_no = pygame.image.load(GRAPHICS_DIR + "/end_no.png") -end_no_rect = end_no.get_rect() +end_no = pygame.image.load(GRAPHICS_DIR + "/end_no.png") +end_no_rect = end_no.get_rect() -saved = pygame.image.load(GRAPHICS_DIR + "/saved.png") -saved_rect = saved.get_rect() +saved = pygame.image.load(GRAPHICS_DIR + "/saved.png") +saved_rect = saved.get_rect() canceled = pygame.image.load(GRAPHICS_DIR + "/canceled.png") -canceled_rect = canceled.get_rect() - -#~ img_info = Image.open(GRAPHICS_DIR + '/info.png') +canceled_rect = canceled.get_rect() @@ -167,16 +165,6 @@ for i in range(0, COUNTDOWN): -# LOAD INFORMATION OVERLAY -img_info = Image.open(GRAPHICS_DIR + '/info.png') -pad_info = Image.new('RGB', ( - ((img_info.size[0] + 31) // 32) * 32, - ((img_info.size[1] + 15) // 16) * 16, -)) -pad_info.paste(img_info, (0, 0)) - - - # FUNCTIONS ======================================================================================== def waitForEvent(): @@ -252,15 +240,7 @@ def makePhotos(): camera.hflip = True camera.resolution = (2592, 1944) camera.rotation = 90 - - # PREVIEW camera.start_preview() - o = camera.add_overlay(pad_info.tostring(), size=img_info.size) - o.alpha = 255 - o.layer = 3 - sleep(3) - camera.remove_overlay(o) - sleep(1) # COUNTDOWN GPIO.output(7, GPIO.HIGH) @@ -303,8 +283,8 @@ def chooseImages(): choices = [] x = 12 for i in range(0, SHOT_COUNT): - img = pygame.image.load("tmp%s.jpg" % i) - img = pygame.transform.scale(img, (THUMB_WIDTH, THUMB_HEIGHT)) + img = pygame.image.load("tmp%s.jpg" % i) + img = pygame.transform.scale(img, (THUMB_WIDTH, THUMB_HEIGHT)) rect = img.get_rect() rect.x = x rect.y = 146