Artemis.ViewModels.DebugViewModel.UpdateRazerDisplay C# (CSharp) Метод

UpdateRazerDisplay() публичный Метод

public UpdateRazerDisplay ( Color colors ) : void
colors System.Windows.Media.Color
Результат void
        public void UpdateRazerDisplay(Color[,] colors)
        {
            // No point updating the display if the view isn't visible
            if (!IsActive)
                return;

            var visual = new DrawingVisual();
            using (var dc = visual.RenderOpen())
            {
                dc.PushClip(new RectangleGeometry(new Rect(0, 0, 22, 6)));
                for (var y = 0; y < 6; y++)
                {
                    for (var x = 0; x < 22; x++)
                        dc.DrawRectangle(new SolidColorBrush(colors[y, x]), null, new Rect(x, y, 1, 1));
                }
            }
            var drawnDisplay = new DrawingImage(visual.Drawing);
            drawnDisplay.Freeze();
            RazerDisplay = drawnDisplay;
        }
    }
DebugViewModel