public virtual Bitmap ToBitmap(ColorGrad.gradElement[] grad) { Bitmap bmp = new Bitmap(map.Width, map.Height); for (int col = 0; col < map.Width; col++) { for (int row = 0; row < map.Height; row++) { bmp.SetPixel(col, row, ColorGrad.getGradColor(grad, outGrid.getTile(row, col).Value)); } } return(bmp); }
public Bitmap gridToBitmap(ColorGrad.gradElement[] grad) { Bitmap img = new Bitmap(width, height); for (int r = 0; r < height; r++) { for (int c = 0; c < width; c++) { img.SetPixel(c, r, ColorGrad.getGradColor(grad, grid[r][c].Value)); } } return(img); }
public Bitmap gridToBitmapOcean(ColorGrad.gradElement[] landGrad, ColorGrad.gradElement[] seaGrad, float seaLevel) { Bitmap img = new Bitmap(width, height); for (int r = 0; r < height; r++) { for (int c = 0; c < width; c++) { if (grid[r][c].Value > seaLevel) { img.SetPixel(c, r, ColorGrad.getGradColor(landGrad, (grid[r][c].Value - seaLevel) / (1 - seaLevel))); } else { img.SetPixel(c, r, ColorGrad.getGradColor(seaGrad, grid[r][c].Value / seaLevel)); } } } return(img); }