public Color ManipulateColor(Rectangle rectangle, BrushRenderTarget renderTarget, Color color)
        {
            int    barSampleIndex = Math.Min(_visualizationProvider.VisualizationData.Length, (int)Math.Floor(_visualizationProvider.VisualizationData.Length * (renderTarget.Point.X / (rectangle.Location.X + rectangle.Size.Width))));
            double curBarHeight   = 1.0 - Math.Max(0f, _visualizationProvider.VisualizationData[barSampleIndex]);
            double verticalPos    = (renderTarget.Point.Y / rectangle.Size.Height);

            return(curBarHeight > verticalPos?color.SetA(0) : color);
        }
Esempio n. 2
0
        public Color ManipulateColor(Rectangle rectangle, BrushRenderTarget renderTarget, Color color)
        {
            var point = renderTarget.Led.AbsoluteLedRectangle.Center;

            if (_bitmap != null && _bitmap.Width - 1 >= point.X && _bitmap.Height - 1 >= point.Y)
            {
                var pixel = _bitmap.GetPixel((int)point.X, (int)point.Y);
                return(new Color(pixel.A, pixel.R, pixel.G, pixel.B));
            }

            return(new Color(0, 0, 0));
        }