此代码引发异常
Bitmap image1;
image1 = (Bitmap)pictureBox1.Image;
for (x = 0; x < image1.Width; x++)
{
for (y = 0; y < image1.Height; y++)
{
image1.SetPixel(x, y, newColor);
}
}
如果我不在此行的图片框中加载图像,则触发
image1.SetPixel(x, y, newColor);
如何决定?
像这样做