Example #1
0
        public void ResetState(SKRect DrawBounds)
        {
            if (_BackgroundImage == null)
            {
                return;
            }
            SKImageFilter PreTileFilter = null;

            if (theFilter != null)
            {
                SKImageFilter si         = SKImageFilter.CreateColorFilter(theFilter);
                Rectangle     AttribRect = new Rectangle(0, 0, _BackgroundImage.Width, _BackgroundImage.Height);
                PreTileFilter = SKImageFilter.CreateBlendMode(SKBlendMode.DstIn, SKImageFilter.CreateImage(_BackgroundImage), si);
                //BackgroundBrush = new SKPaint
                //{
                //    ImageFilter = SKImageFilter.CreateBlendMode(SKBlendMode.DstIn, SKImageFilter.CreateImage(_BackgroundImage), si)
                //};
            }
            else
            {
                PreTileFilter = SKImageFilter.CreateImage(_BackgroundImage);
                //BackgroundBrush = new SKPaint()
                //{
                //    ImageFilter = SKImageFilter.CreateImage(_BackgroundImage)
                //};
            }
            SKRect Bound = new SKRect(0, 0, _BackgroundImage.Width, _BackgroundImage.Height);

            PrimaryFilter   = SKImageFilter.CreateTile(Bound, new SKRect(-4096, -4096, 4096, 4096), PreTileFilter);
            BackgroundBrush = new SKPaint()
            {
                ImageFilter = PrimaryFilter
            };
            //BackgroundBrush.WrapMode = WrapMode.Tile;
        }