Exemple #1
0
        private static Brush GetTiledSamples_ONE(Point[] edgePoints, ISOMInput[] samples)
        {
            var aabb = Math2D.GetAABB(edgePoints);

            var colors = Enumerable.Range(0, 256).
                         Select(o => UtilityWPF.GetRandomColor(64, 192)).
                         ToArray();

            //BitmapSource bitmap = UtilityWPF.GetBitmap_Aliased(colors, 16, 16, 300, 300);
            BitmapSource bitmap = UtilityWPF.GetBitmap_Aliased(colors, 16, 16, (aabb.Item2.X - aabb.Item1.X).ToInt_Round(), (aabb.Item2.Y - aabb.Item1.Y).ToInt_Round());

            return(new ImageBrush(bitmap)
            {
                Stretch = Stretch.None,
            });
        }