I have as part of an assignment a task to open and manipulate raster datasets stored in an ascii string format. The main of the task is complete with the processing part working fine, however I want to implement a method that takes this string data and converts it into bitmap data.

My experience using image data formats in programming is fairly minimal however I see this task as something I can use to start learning as I will at some point.

Ok so some information about the program as it is...

Clicking open simply takes the .asc similar ascii filename and passes it to a newly created object Grid, a class I have written for this program.

The constructor takes this file and uses a streamreader to line by line read through the data splitting it down and storing it in a 2 dimensional array 'values[,]'. Each grid is processed seperatly as requested and not stored as a data member as part of a list or such. Just simply as the variable 'g1'.

I want to add a button to the form that takes the data stored in the current instance of g1.values[,] and stores it as a bitmap file. I have already implemented an LinearScale8Bit method that takes the data and converts it to use values between 0 and 255 respective to their initial values.

Some of the methods may be sloppy, as they are part of a practical set by my tutor, or they may be the simplest, I am not an expert and cannot give any recommendations on those.

The methods I have written from scratch are:
GridGlobalPearsonCorrelation
GridNormalisedDifferenceVegetation
GridWindowMean
LinearScale8Bit

The other methods will have heavy influence from my programming style however as I said, the basic algorithm was supplied by my tutor.

Hopefully while looking at the code you understand my problem and the aim of the program a bit better, here are some links that could prove useful.

Input File Example:
http://codepaste.net/e5kupi

Grid Class:
http://codepaste.net/zu9jce

Any help is greatly appreciated.

Cheers
earlbob91