Exemple #1
0
 public LedWallViewport()
 {
     InitializeComponent();
     _ledWall = new LedWallDriver(LedsPerStrip, StripCount);
     bw       = new BackgroundWorker();
     bw.WorkerSupportsCancellation = true;
     bw.DoWork += Bw_DoWork;
 }
Exemple #2
0
        static void Main(string[] args)
        {
            _ledWall = new LedWallHardwareDriver(LedsPerStrip, StripCount);
            //timer = new Timer(takeScreenshot, null, 0, FrameDelay);

            bw = new BackgroundWorker();
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += Bw_DoWork;
            bw.RunWorkerAsync();

            while (true)
            {
                Thread.Sleep(50);
            }
        }
Exemple #3
0
        public MainWindow()
        {
            // get the kinectSensor object
            this.kinectSensor = KinectSensor.GetDefault();

            // open the reader for the depth frames
            this.bodyIndexFrameReader = this.kinectSensor.BodyIndexFrameSource.OpenReader();

            // wire handler for frame arrival
            this.bodyIndexFrameReader.FrameArrived += this.Reader_FrameArrived;

            this.bodyIndexFrameDescription = this.kinectSensor.BodyIndexFrameSource.FrameDescription;

            // allocate space to put the pixels being converted
            this.bodyIndexPixels = new uint[this.bodyIndexFrameDescription.Width * this.bodyIndexFrameDescription.Height];

            // create the bitmap to display
            this.bodyIndexBitmap = new WriteableBitmap(this.bodyIndexFrameDescription.Width, this.bodyIndexFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);

            // set IsAvailableChanged event notifier
            this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged;

            // open the sensor
            this.kinectSensor.Open();

            // use the window object as the view model in this simple example
            this.DataContext = this;

            InitializeComponent();
            IsPlaying(false);

            // Initialize hardware driver
            _ledWall = new LedWallHardwareDriver(LedsPerStrip, StripCount);

            bw                            = new BackgroundWorker();
            bw.DoWork                    += Bw_DoWork;
            bw.RunWorkerCompleted        += Bw_RunWorkerCompleted;
            bw.WorkerSupportsCancellation = true;
            bw.RunWorkerAsync();

            formClosing = false;
        }
Exemple #4
0
        public LedWallInteract()
        {
            InitializeComponent();
            convTimes = new List <TimeSpan>();

            // Initialize hardware driver
            _ledWall = new LedWallHardwareDriver(LedsPerStrip, StripCount);

            rainbow = new Color[LedsPerStrip];
            int steps = LedsPerStrip / gamut.Length;

            for (int i = 0; i < gamut.Length; i++)
            {
                Color[] iter = InterpolateColors(gamut[i], gamut[(i + 1) % gamut.Length], steps);
                Array.Copy(iter, 0, rainbow, i * steps, Math.Min(iter.Length, LedsPerStrip - (i * steps)));
            }

            bw  = null;
            avs = null;
        }