<filename>wxVidCap.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Wed Sep  1 13:15:36 2010

import wx
from wxueye.wxVidWindow import wxVidWindow
from wxueye.wxVidConfig import wxVidConfig
import ueye
# begin wxGlade: extracode
# end wxGlade



class wxVidFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: wxVidFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.vidWindow = wxVidWindow(self, -1)
        self.button_1 = wx.ToggleButton(self, -1, u"Visualización")
        self.button_2 = wx.Button(self, -1, "Capturar imagen")
        self.btnConfig = wx.Button(self, -1, "Configurar")
        self.button_4 = wx.Button(self, -1, "Seleccionar Camara")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRunningVid, self.button_1)
        self.Bind(wx.EVT_BUTTON, self.OnConfig, self.btnConfig)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: wxVidFrame.__set_properties
        self.SetTitle("Visualizador de Camaras")
        self.vidWindow.SetMinSize((400,400))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: wxVidFrame.__do_layout
        sizer_3 = wx.BoxSizer(wx.VERTICAL)
        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_3.Add(self.vidWindow, 1, wx.EXPAND, 0)
        sizer_4.Add(self.button_1, 0, 0, 0)
        sizer_4.Add(self.button_2, 0, 0, 0)
        sizer_4.Add(self.btnConfig, 0, 0, 0)
        sizer_4.Add(self.button_4, 0, 0, 0)
        sizer_3.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
        self.SetSizer(sizer_3)
        sizer_3.Fit(self)
        self.Layout()
        # end wxGlade

    def OnRunningVid(self, event): # wxGlade: wxVidFrame.<event_handler>
        """Start and stop video preview """
        if self.button_1.GetValue():
            self.vidWindow.StartLiveVideo()
        else:
            self.vidWindow.StopLiveVideo()
        event.Skip()

    def OnConfig(self, event): # wxGlade: wxVidFrame.<event_handler>
        dlg=wxVidConfig(self,cam=self.vidWindow.cam)
        dlg.ShowModal()
        dlg.Destroy()
        event.Skip()

# end of class wxVidFrame

cam=ueye.Cam()     # Get the first available cam
cam.SetColorMode (ueye.CM_BGR8_PACKED) 

if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    vidframe = wxVidFrame(None, -1, "")
    vidframe.vidWindow.cam=cam
    app.SetTopWindow(vidframe)
    vidframe.Show()
    app.MainLoop()

<filename>wxVidCap.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Wed Sep  1 13:15:36 2010

import wx
from wxueye.wxVidWindow import wxVidWindow
from wxueye.wxVidConfig import wxVidConfig
import ueye
# begin wxGlade: extracode
# end wxGlade



class wxVidFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: wxVidFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.vidWindow = wxVidWindow(self, -1)
        self.button_1 = wx.ToggleButton(self, -1, u"Visualización")
        self.button_2 = wx.Button(self, -1, "Capturar imagen")
        self.btnConfig = wx.Button(self, -1, "Configurar")
        self.button_4 = wx.Button(self, -1, "Seleccionar Camara")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRunningVid, self.button_1)
        self.Bind(wx.EVT_BUTTON, self.OnConfig, self.btnConfig)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: wxVidFrame.__set_properties
        self.SetTitle("Visualizador de Camaras")
        self.vidWindow.SetMinSize((400,400))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: wxVidFrame.__do_layout
        sizer_3 = wx.BoxSizer(wx.VERTICAL)
        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_3.Add(self.vidWindow, 1, wx.EXPAND, 0)
        sizer_4.Add(self.button_1, 0, 0, 0)
        sizer_4.Add(self.button_2, 0, 0, 0)
        sizer_4.Add(self.btnConfig, 0, 0, 0)
        sizer_4.Add(self.button_4, 0, 0, 0)
        sizer_3.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
        self.SetSizer(sizer_3)
        sizer_3.Fit(self)
        self.Layout()
        # end wxGlade

    def OnRunningVid(self, event): # wxGlade: wxVidFrame.<event_handler>
        """Start and stop video preview """
        if self.button_1.GetValue():
            self.vidWindow.StartLiveVideo()
        else:
            self.vidWindow.StopLiveVideo()
        event.Skip()

    def OnConfig(self, event): # wxGlade: wxVidFrame.<event_handler>
        dlg=wxVidConfig(self,cam=self.vidWindow.cam)
        dlg.ShowModal()
        dlg.Destroy()
        event.Skip()

# end of class wxVidFrame

cam=ueye.Cam()     # Get the first available cam
cam.SetColorMode (ueye.CM_BGR8_PACKED) 

if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    vidframe = wxVidFrame(None, -1, "")
    vidframe.vidWindow.cam=cam
    app.SetTopWindow(vidframe)
    vidframe.Show()
    app.MainLoop()

#!/usr/bin/env python # -*- coding: utf-8 -*- # generated by wxGlade 0.6.3 on Wed Sep  1 13:15:36 2010 # begin wxGlade: extracode # end wxGlade # begin wxGlade: wxVidFrame.__init__ # end wxGlade # begin wxGlade: wxVidFrame.__set_properties # end wxGlade # begin wxGlade: wxVidFrame.__do_layout # end wxGlade # wxGlade: wxVidFrame.<event_handler> Start and stop video preview # wxGlade: wxVidFrame.<event_handler> # end of class wxVidFrame # Get the first available cam