コード例 #1
0
        public FrameDisplay()
        {
            InitializeComponent();
            SizeChanged += FrameDisplay_SizeChanged;

            _frame = new Frame(0);

            _width  = ConfigConstant.GetInt("FRAME_WIDTH");
            _height = ConfigConstant.GetInt("FRAME_HEIGHT");

            Dad.Columns = _width;
            Dad.Rows    = _height;

            pixels = new DrawablePixel[_width * _height];

            for (int i = 0; i < _height; i++)
            {
                for (int j = 0; j < _width; j++)
                {
                    DrawablePixel pixel = new DrawablePixel(this, GridHelper.GetGridNumber(i, j));
                    pixel.SetValue(Grid.RowProperty, i);
                    pixel.SetValue(Grid.ColumnProperty, j);
                    Dad.Children.Add(pixel);

                    pixels[GridHelper.GetGridNumber(i, j)] = pixel;
                }
            }
        }
コード例 #2
0
        public FramePreview()
        {
            InitializeComponent();
            SizeChanged += FrameDisplay_SizeChanged;

            _frame = new Frame(0);

            _width  = ConfigConstant.GetInt("FRAME_WIDTH");
            _height = ConfigConstant.GetInt("FRAME_HEIGHT");

            pixels = new PixelDisplay[_width * _height];

            for (int i = 0; i < _height; i++)
            {
                StackPanel stackPanel = new StackPanel();
                stackPanel.Orientation = Orientation.Horizontal;
                for (int j = 0; j < _width; j++)
                {
                    PixelDisplay pixel = new PixelDisplay(this, _frame.GetPixel(i, j));

                    stackPanel.Children.Add(pixel);
                    pixels[GridHelper.GetGridNumber(i, j)] = pixel;
                }
                Dad.Children.Add(stackPanel);
            }

            Update();
        }
コード例 #3
0
        // Refresh the display according to the Frame property
        public void Update()
        {
            int width  = ConfigConstant.GetInt("FRAME_WIDTH");
            int height = ConfigConstant.GetInt("FRAME_HEIGHT");

            for (int i = 0; i < width * height; i++)
            {
                pixels[i].Rect.Fill = new SolidColorBrush(Frame.GetPixel(i).Color);
            }
        }
コード例 #4
0
ファイル: Frame.cs プロジェクト: dj46563/HouseMouseCheese
        public Frame(int number)
        {
            Number = number;
            int width  = ConfigConstant.GetInt("FRAME_WIDTH");
            int height = ConfigConstant.GetInt("FRAME_HEIGHT");

            Pixels = new Pixel[width * height];
            for (int i = 0; i < Pixels.Length; i++)
            {
                Pixels[i] = new Pixel();
            }
        }
コード例 #5
0
        // Refresh the display according to the Frame property
        public void Update()
        {
            NumberDisplay.Text = $"Frame: {_frame.Number + 1}";

            int width  = ConfigConstant.GetInt("FRAME_WIDTH");
            int height = ConfigConstant.GetInt("FRAME_HEIGHT");

            for (int i = 0; i < width * height; i++)
            {
                pixels[i].Rect.Fill = new SolidColorBrush(_frame.GetPixel(i).Color);
            }
        }