我是c#的初学者。我希望将图片从 pictureBox1 保存到本地磁盘,那么我需要执行哪些步骤?
private void button1_Click(object sender, EventArgs e)
{
Graphics g;
int i = 9;
int k;
String[] letter1 = new String[9] { "b", "W", "b", "w", "B", "w", "B", "w", "B" };
g= pictureBox1.CreateGraphics();
Pen b = new Pen(Color.Black, 1.0f);
Pen B = new Pen(Color.Black, 2.0f);
Pen w = new Pen(Color.White, 1.0f);
Pen W = new Pen(Color.White, 2.0f);
for (int j = 0; j <= 8; j++)
{
String array = letter1[j];
if (array.Equals("b") || array.Equals("w"))
{
i = i + 1;
k = 50;
if (array.Equals("b"))
{
g.DrawLine(b, i, 10, i, k);
}
}
else
if (array.Equals("B") || array.Equals("W"))
{
i = i + 2;
k = 51;
if (array.Equals("B"))
g.DrawLine(B, i, 10, i, k);
}
}