I have
string[] filenames = Directory.GetFiles(@"C:\temp\test", "*.png", SearchOption.AllDirectories);
string[] myArr = new string[10];
private void btnLoadTrainingData_Click(object sender, EventArgs e)
{
foreach (string f in filenames)
{
img = (Bitmap)Bitmap.FromFile(f);
Console.WriteLine(convertToBinary(img));
}
}
The method 'convertToBinary' returns a string value of 1's and 0's of the converted image.
What I need is how to store the string of each returned value in an array + the filename.
I want something like this:
A_001.png 100100011
A_002.png 100110011
B_001.png 001110111
etc
I have tried to implement an array (see below) but I am always getting the last file that was opened.
private void populateArray(string binVal)
{
for (int j = 0; j < myArr.Length; j++)
{
myArr[j] = (binVal);
}