Why am I getting "parameter is not valid" exception on this code?
<pre><code>private void button8_Click(object sender, EventArgs e)
{
            List&lt;long&gt; averages;
            long res = 0;
            _fi = new DirectoryInfo(subDirectoryName).GetFiles("*.bmp");
            averages = new List&lt;long&gt;(_fi.Length);
            for (int i = 0; i &lt; _fi.Length; i++)
            {
                Bitmap myBitmaps = new Bitmap(_fi[i].Name);
                //long[] tt = list_of_histograms[i];
                long[] HistogramValues = GetHistogram(myBitmaps);
                res = GetTopLumAmount(HistogramValues,1000);
                averages.Add(res);
            }
}
</code></pre>

<p>The exception is on the line: </p>

<pre><code>Bitmap myBitmaps = new Bitmap(_fi[i].Name);
</code></pre>
