I'm new to programming, and everything what i done until now was research and implementing to fit my needs...
Currently I'm creating dataTable like this :
private void GridOfBitmaps()
{
Bitmap OriginBitmap = new Bitmap(pictureBox1.Image);
DataTable LightnessTable = new DataTable("Lightness");
for (int x = 0; x < pictureBox1.Width-20; x+= 20)
{
LightnessTable.Columns.Add("C" + x, typeof(string));
for (int y = 0; y < pictureBox1.Height-20; y += 20)
{
RectangleF smallRect = new RectangleF(x, y, 20, 20);
System.Drawing.Imaging.PixelFormat format =
OriginBitmap.PixelFormat;
Bitmap cloneBitmap = OriginBitmap.Clone(smallRect, format);
string avgLightness = Convert.ToString(CalculateAverageLightness(cloneBitmap));
int index = avgLightness.IndexOf(",");
if (index > 0)
avgLightness = avgLightness.Substring(0, index);
if (x <= 0)
{
DataRow row = LightnessTable.NewRow();
row["C" + x] = avgLightness;
LightnessTable.Rows.Add(row);
}
else
{
LightnessTable.Rows[y / 20]["C" + x] = avgLightness;
}
}
}
This function is signed to button, so on everyclick I'm geting new datatable.
DataTable rows holds values in range from 0 to 255 (string), i would like to be able to compare 2 datatables created in that way (cell by cell to determine if value is higher).
EDIT#: Question : How to store those datatables during program running so i can compare them later?
I can't use database. Thank You !