コード例 #1
0
 public void Execute(LedStrip strip)
 {
     int highlight = (strip.GetNumLeds() - 1) * Cursor.Position.X / width;
     Pixel[] pixels = strip.GetPixelArray();
     effect.Apply(pixels);
     pixels[119 - highlight] = effect.CreatePixel(new StaticColor(Color.White));
     strip.OutputPixels(pixels);
 }
コード例 #2
0
        public ProgramContext(MainForm form)
        {
            mainForm = form;
            mainForm.SetContext(this);
            form.FormClosed += new FormClosedEventHandler(this.Exit);

            LibMpsse.Init();
            spiOutput = new SPIOutput();
            ledStrip = new LedStrip(spiOutput, 120);
            Debug.WriteLine("Initialized");

            timer = new Timer();
            timer.Interval = 25;
            timer.Tick += new EventHandler(this.Tick);
            timer.Start();

            form.SetLedStrip(ledStrip);
            form.Show();
        }
コード例 #3
0
 public void Execute(LedStrip strip)
 {
     Pixel[] array = strip.GetPixelArray();
     effect.Apply(array);
     strip.OutputPixels(array);
 }
コード例 #4
0
 public void SetLedStrip(LedStrip strip)
 {
     solidColor = new SolidColor();
     mouseFollower = new MouseFollower();
 }