bugfix
This commit is contained in:
parent
ac8b3969cb
commit
606a0854d6
@ -1,30 +1,31 @@
|
||||
|
||||
import kivy
|
||||
from PIL import ImageGrab
|
||||
import numpy as np
|
||||
from .micphone import Micphone
|
||||
from kivy.uix.camera import Camera
|
||||
from kivy.properties import NumericProperty
|
||||
from kivy.event import EventDispatcher
|
||||
|
||||
class ScreenWithMic(Micphone, EventDispatcher):
|
||||
def __init__(self, **kw):
|
||||
super(ScreenWithMic, self).__init__(**kw)
|
||||
if kivy.platform in [ 'win', 'linux', 'macosx' ]:
|
||||
from PIL import ImageGrab
|
||||
class ScreenWithMic(Micphone, EventDispatcher):
|
||||
def __init__(self, **kw):
|
||||
super(ScreenWithMic, self).__init__(**kw)
|
||||
|
||||
def get_image_data(self):
|
||||
image = ImageGrab.grab()
|
||||
imgdata = image.tostring()
|
||||
return imgdata
|
||||
|
||||
def get_fps_data(self, *args):
|
||||
ad = super(CameraWithMic, self).get_fps_data()
|
||||
vd = self.get_image_data()
|
||||
d = {
|
||||
'v':vd,
|
||||
'a':ad
|
||||
}
|
||||
return d
|
||||
|
||||
def get_image_data(self):
|
||||
image = ImageGrab.grab()
|
||||
imgdata = image.tostring()
|
||||
return imgdata
|
||||
|
||||
def get_fps_data(self, *args):
|
||||
ad = super(CameraWithMic, self).get_fps_data()
|
||||
vd = self.get_image_data()
|
||||
d = {
|
||||
'v':vd,
|
||||
'a':ad
|
||||
}
|
||||
return d
|
||||
|
||||
class CameraWithMic(Micphone, Camera):
|
||||
angle = NumericProperty(0)
|
||||
def __init__(self, **kw):
|
||||
|
Loading…
Reference in New Issue
Block a user