是否可以加载和显示更快的100(10x10)图片框?所有图像的大小均为40x40像素(5KB)。我认为有比我的代码更好的方法,但我现在是一个太大的新手。
PictureBox[,] tile = new PictureBox[10,10];
for (int j = 0; j < 10; j++)
{
for (int i = 0; i < 10; i++)
{
tile[j, i] = new PictureBox();
if (mapa[j,i] == 0) tile[j, i].ImageLocation = folder + @"\\Images\ground.bmp";
if (mapa[j, i] == 1) tile[j, i].ImageLocation = folder + @"\\Images\\lava.bmp";
if (mapa[j, i] == 2) tile[j, i].ImageLocation = folder + @"\\Images\\win.bmp";
tile[j, i].Location = new Point(10 + (41 * j), 10 + (41 * i));
tile[j, i].SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
progressBar1.Increment(1);
this.Refresh();
}
}