My goal is to display the same icon twice, but each time in different size. I tried the following:
FileStream fs = new FileStream("name_of_the_icon_file.ico", FileMode.Open);
Icon ico = new Icon(fs, 32, 32); //create an in-memory instance of the icon, size 32x32
Icon ico2 = new Icon(fs, 16, 16); //create an in-memory instance of the icon, size 16x16
...
Graphics.DrawIcon(ico, /*some point*/);
Graphics.DrawIcon(ico2, /*some other point*/);
The last line throws an ArgumentException: Value does not fall within the expected range. Can some one explain me whats wrong and whats the way to do this right?