Fixing the camera 9

The resolution is now 1/4
pull/1/head
Julius Riegel 7 years ago
parent 9ec43e7e41
commit f166d26a4a

@ -41,8 +41,8 @@
<file leaf-file-name="graphiclib.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/graphiclib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="236">
<caret line="75" column="37" lean-forward="false" selection-start-line="75" selection-start-column="37" selection-end-line="75" selection-end-column="37" />
<state relative-caret-position="253">
<caret line="76" column="70" lean-forward="false" selection-start-line="76" selection-start-column="70" selection-end-line="76" selection-end-column="70" />
<folding>
<element signature="e#0#28#0" expanded="true" />
</folding>
@ -493,8 +493,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/lib/graphiclib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="236">
<caret line="75" column="37" lean-forward="false" selection-start-line="75" selection-start-column="37" selection-end-line="75" selection-end-column="37" />
<state relative-caret-position="253">
<caret line="76" column="70" lean-forward="false" selection-start-line="76" selection-start-column="70" selection-end-line="76" selection-end-column="70" />
<folding>
<element signature="e#0#28#0" expanded="true" />
</folding>

@ -74,7 +74,7 @@ class PiCamera(pygame.sprite.Sprite):
pygame.camera.init()
camera = picamera.PiCamera()
self.camsize = (size[0], int(size[0]/2))
camera.resolution = self.camsize
camera.resolution = int(self.camsize[0]/2), int(self.camsize[1]/2)
self.camera = camera
self.output = picamera.array.PiRGBArray(camera, size=self.camsize)
self.size = size
@ -87,5 +87,5 @@ class PiCamera(pygame.sprite.Sprite):
print('updating camera')
self.output.truncate(0)
self.camera.capture(self.output, 'rgb', resize=self.camsize)
s = pygame.transform.rotate(pygame.surfarray.make_surface(self.output.array), 90)
s = pygame.transform.rotate(pygame.surfarray.make_surface(self.output.array), 270)
self.image.blit(s, (0, 0))
Loading…
Cancel
Save