diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3972b70..30de114 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -41,8 +41,8 @@ - - + + @@ -493,8 +493,8 @@ - - + + diff --git a/lib/graphiclib.py b/lib/graphiclib.py index 726119f..3840758 100644 --- a/lib/graphiclib.py +++ b/lib/graphiclib.py @@ -73,9 +73,10 @@ class PiCamera(pygame.sprite.Sprite): pygame.sprite.Sprite.__init__(self) pygame.camera.init() camera = picamera.PiCamera() - camera.resolution = (1280/2, 720/2) + self.camsize = (self.size[0], int(self.size[0]/2)) + camera.resolution = self.camsize self.camera = camera - self.output = picamera.array.PiRGBArray(camera, size=(1280/2, 720/2)) + self.output = picamera.array.PiRGBArray(camera, size=self.camsize) self.size = size self.image = pygame.Surface(self.size) self.image.fill((0, 0, 0)) @@ -85,6 +86,6 @@ class PiCamera(pygame.sprite.Sprite): def update(self, *args): print('updating camera') self.output.truncate(0) - self.camera.capture(self.output, 'rgb', resize=(1280/2, 720/2)) + self.camera.capture(self.output, 'rgb', resize=self.camsize) s = pygame.transform.rotate(pygame.surfarray.make_surface(self.output.array), 90) self.image.blit(s, (0, 0)) \ No newline at end of file