WITH#. The "Diamond-Square" algorithm generates a double[x, y] array. Tell me how to get an image of a height map from an array of heights? To get something like this:

Elevation map

    1 answer 1

    You have the dimensions of the image (the dimensions of the array) and for each point coordinate (array indices) there is a number that can lead to the color of the pixel.

    Create a bitmap of the desired size. We get the desired color for each pixel (well, let's say through Color.FromArgb() ). Via Bitmap.SetPixel() set this color.

    • Thanks for the comment. Everything worked out. Thank! - Chill