Exemplo n.º 1
0
        public static Bitmap GenerateCompositeMap(HeightData data, Bitmap baseMap, float heightmapIntensity, float hillshadeIntensity)
        {
            Bitmap result;

            if (baseMap == null)
            {
                result = new Bitmap(data.GridWidth, data.GridHeight);
                var graphics = Graphics.FromImage(result);
                graphics.FillRectangle(new SolidBrush(Color.Gray), new Rectangle(0, 0, baseMap.Width, baseMap.Height));
            }
            else
            {
                result = baseMap;
            }
            if (heightmapIntensity > 0)
            {
                Bitmap hm = new ImageGenerator(data.GetDataGrid(), data.cellSize, ImageType.Heightmap, data.lowPoint, data.highPoint).image;
                result = OverlayBlend(result, hm, heightmapIntensity);
            }
            if (hillshadeIntensity > 0)
            {
                Bitmap hs = new ImageGenerator(data.GetDataGrid(), data.cellSize, ImageType.Hillshade, data.lowPoint, data.highPoint).image;
                result = OverlayBlend(result, hs, hillshadeIntensity);
            }
            return(result);
        }
Exemplo n.º 2
0
        bool WriteFileImage(HeightData source, string filename, FileFormat ff)
        {
            float[,] grid = source.GetDataGrid();
            IExporter exporter = new ImageGenerator(grid, source.cellSize, ff.GetImageType(), source.lowPoint, source.highPoint);

            ExportUtility.WriteFile(exporter, filename, ff);
            return(true);
        }