Пример #1
0
        public SignWindow(RemoteControllerLink ctrl, Button s)
        {
            InitializeComponent();
            this.ctrl = ctrl;
            this.s    = s;
            if (ctrl.Scr != null)
            {
                X = ctrl.Scr.groupConfigs[0].signConfigs[0].width;
                Y = ctrl.Scr.groupConfigs[0].signConfigs[0].height;
            }
            else if (ctrl.Sesr != null)
            {
                X = ctrl.Sesr.signExtendedStatusEntry[0].columns;
                Y = ctrl.Sesr.signExtendedStatusEntry[0].rows;
            }
            else
            {
                throw new Exception("Can't get sign width & height");
            }
            virtualSign = new VirtualSign(SignArea, X, Y);

            bgWorker = new BackgroundWorker();
            bgWorker.WorkerReportsProgress      = true;
            bgWorker.WorkerSupportsCancellation = true;
            bgWorker.DoWork          += DoWork_Handler;
            bgWorker.ProgressChanged += ProgressChanged_Handler;
            //bgWorker.RunWorkerCompleted += RunWorkerCompleted_Handler;
            bgWorker.RunWorkerAsync(ctrl);
            s.IsEnabled = false;
        }
Пример #2
0
        private void RedrawCanvas(Color[,] mc)
        {
            gridFrmFrameContent.Children.Clear();
            gridFrmFrameContent.Children.Add(canvas);
            VirtualSign virtualSign = new VirtualSign(canvas, pixelWidth, pixelHeight);

            virtualSign.Display(mc);
        }
Пример #3
0
        private void LoadGfx(int[,] gfxFrame)
        {
            for (int x = 0; x < pixelWidth; x++)
            {
                for (int y = 0; y < pixelHeight; y++)
                {
                    bmpPixels[x, y] = new System.Windows.Media.Color
                    {
                        A = 255,
                        R = (byte)(gfxFrame[x, y] >> 16),
                        G = (byte)(gfxFrame[x, y] >> 8),
                        B = (byte)(gfxFrame[x, y])
                    };
                }
            }
            gridFrmFrameContent.Children.Clear();
            gridFrmFrameContent.Children.Add(canvas);
            VirtualSign virtualSign = new VirtualSign(canvas, pixelWidth, pixelHeight);

            virtualSign.Display(bmpPixels);
        }