Display images after capture

master
Guillaume Dott 2017-10-04 00:33:23 +02:00
parent 4f7a833151
commit 933f63d146
3 changed files with 245 additions and 185 deletions

BIN
film.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

360
film.svg
View File

@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="158.44232"
inkscape:cy="306.45609"
inkscape:cx="-27.035262"
inkscape:cy="235.80716"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
@ -39,7 +39,9 @@
inkscape:window-height="1041"
inkscape:window-x="1680"
inkscape:window-y="18"
inkscape:window-maximized="0" />
inkscape:window-maximized="0"
showguides="true"
inkscape:guide-bbox="true" />
<metadata
id="metadata5">
<rdf:RDF>
@ -59,192 +61,240 @@
transform="translate(0,-169.99998)">
<path
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:46.70000076;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 0 0 L 0 480 L 800 480 L 800 0 L 0 0 z M 93.318359 49.21875 L 706.68164 49.21875 C 712.93523 49.21875 717.96875 54.252275 717.96875 60.505859 L 717.96875 419.49414 C 717.96875 425.74773 712.93523 430.78125 706.68164 430.78125 L 93.318359 430.78125 C 87.064775 430.78125 82.03125 425.74773 82.03125 419.49414 L 82.03125 60.505859 C 82.03125 54.252275 87.064775 49.21875 93.318359 49.21875 z "
d="M 0 0 L 0 480 L 800 480 L 800 0 L 0 0 z M 95.380859 34.939453 L 704.61914 34.939453 C 712.58576 34.939453 719 41.351744 719 49.318359 L 719 430.68164 C 719 438.64826 712.58576 445.06055 704.61914 445.06055 L 95.380859 445.06055 C 87.414244 445.06055 81 438.64826 81 430.68164 L 81 49.318359 C 81 41.351744 87.414244 34.939453 95.380859 34.939453 z "
transform="matrix(0.26458333,0,0,0.26458333,0,169.99998)"
id="rect815" />
<rect
ry="2.9866323"
y="75.516975"
x="21.703856"
height="100.95536"
width="168.25896"
ry="3.1763959"
y="68.898209"
x="21.609423"
height="107.36983"
width="168.80417"
id="rect825"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:13.01773548;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:13.44665909;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
id="g884"
transform="matrix(1.3669969,0,0,1.3669969,-1.1178441,-87.867666)">
<rect
ry="2.9866323"
y="290.52762"
x="21.703856"
height="100.95536"
width="168.25896"
id="rect827"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:13.01773548;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
ry="1.6657715"
y="168.17415"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect840"
width="15.100727"
height="10.537298"
x="3.0459228"
y="168.17415"
ry="2.2678576" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect842"
width="0.93544334"
height="0.33408689"
x="13.163024"
y="176.52824"
ry="0.16704345" />
<rect
ry="2.2678576"
y="182.12778"
x="3.0459228"
height="10.537298"
width="15.100727"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect844"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
width="11.091684"
height="7.7397852"
x="3.0459228"
y="178.68185"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
ry="1.6657715"
y="189.18956"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect846"
width="15.100727"
height="10.537298"
x="3.0459228"
y="196.08139"
ry="2.2678576" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="210.035"
x="3.0459228"
height="10.537298"
width="15.100727"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect848"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
width="11.091684"
height="7.7397852"
x="3.0459228"
y="199.69727"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
ry="1.6657715"
y="210.20496"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect850"
width="15.100727"
height="10.537298"
x="3.0459228"
y="223.98862"
ry="2.2678576" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="237.94225"
x="3.0459228"
height="10.537298"
width="15.100727"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect852"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
width="11.091684"
height="7.7397852"
x="3.0459228"
y="220.71266"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
ry="1.6657715"
y="231.22035"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect854"
width="15.100727"
height="10.537298"
x="3.0459228"
y="251.89586"
ry="2.2678576" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="265.84949"
x="3.0459228"
height="10.537298"
width="15.100727"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect856"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
width="11.091684"
height="7.7397852"
x="3.0459228"
y="241.72806"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
ry="1.6657715"
y="252.23576"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect858"
width="15.100727"
height="10.537298"
x="3.0459228"
y="279.8031"
ry="2.2678576" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="293.75671"
x="3.0459228"
height="10.537298"
width="15.100727"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect860"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
width="11.091684"
height="7.7397852"
x="3.0459228"
y="262.74347"
ry="1.6657715" />
<rect
ry="2.2678576"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect836"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="273.25116"
ry="1.6657715" />
<rect
ry="1.6657715"
y="283.75888"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect838"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect841"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="294.26657"
ry="1.6657715" />
</g>
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:13.44665909;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect905"
width="168.80417"
height="107.36983"
x="21.609423"
y="291.26645"
ry="3.1763959" />
<g
transform="matrix(1.3669969,0,0,1.3669969,189.38216,-87.867666)"
id="g4581">
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4555"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="168.17415"
x="193.16795"
height="10.537298"
width="15.100727"
id="rect862"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect864"
width="15.100727"
height="10.537298"
x="193.16795"
y="182.12778"
ry="2.2678576" />
ry="1.6657715"
y="178.68185"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4557"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="196.08139"
x="193.16795"
height="10.537298"
width="15.100727"
id="rect866"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4559"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="189.18956"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect868"
width="15.100727"
height="10.537298"
x="193.16795"
y="210.035"
ry="2.2678576" />
ry="1.6657715"
y="199.69727"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4561"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="223.98862"
x="193.16795"
height="10.537298"
width="15.100727"
id="rect870"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4563"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="210.20496"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect872"
width="15.100727"
height="10.537298"
x="193.16795"
y="237.94225"
ry="2.2678576" />
ry="1.6657715"
y="220.71266"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4565"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="251.89586"
x="193.16795"
height="10.537298"
width="15.100727"
id="rect874"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4567"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="231.22035"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect876"
width="15.100727"
height="10.537298"
x="193.16795"
y="265.84949"
ry="2.2678576" />
ry="1.6657715"
y="241.72806"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4569"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2.2678576"
y="279.8031"
x="193.16795"
height="10.537298"
width="15.100727"
id="rect878"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4571"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="252.23576"
ry="1.6657715" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:12.35604191;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect880"
width="15.100727"
height="10.537298"
x="193.16795"
y="293.75671"
ry="2.2678576" />
ry="1.6657715"
y="262.74347"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4573"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="1.6657715"
y="273.25116"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4575"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4577"
width="11.091684"
height="7.7397852"
x="3.0459228"
y="283.75888"
ry="1.6657715" />
<rect
ry="1.6657715"
y="294.26657"
x="3.0459228"
height="7.7397852"
width="11.091684"
id="rect4579"
style="opacity:1;fill:#fcffff;fill-opacity:1;stroke:none;stroke-width:9.07567692;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -46,6 +46,7 @@ except:
def take(self, name):
print('Take picture! ' + name)
return self.img
def draw_on(self, screen):
screen.blit(self.img, self.rect)
@ -102,6 +103,8 @@ class CaptureButton(Button):
self.font = pygame.font.Font(None, 80)
self.photo_film = pygame.image.load('film.png').convert_alpha()
def draw_on(self, screen):
if self.enabled:
super(CaptureButton, self).draw_on(screen)
@ -140,6 +143,13 @@ class CaptureButton(Button):
capture.take(self.photoboite.camera)
pygame.time.wait(1000)
for photo in capture.photos:
self.photoboite.screen.blit(self.photo_film, (0, 0))
pygame.display.flip()
pygame.time.wait(1000)
self.photoboite.event()
pygame.event.set_allowed((pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP))
self.capture_mode = False
self.enabled = True