-1
我一直在試圖將圖像保存在pictureBox1中。試圖做的是讓人們可以通過點擊我的「另存爲」按鈕來「保存」pictureBox1中的圖像。C#將Button1保存在Pitcherbox1中.png
我使用Visual Studio 2010中使用C#
這是我到目前爲止有:
private void Button2_Click(System.Object sender, System.EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "Png Image|*.jpg";
saveFileDialog1.Title = "Save an Image File";
saveFileDialog1.ShowDialog();
if (saveFileDialog1.FileName != "")
pictureBox1.Image = new Bitmap ("c:/avatar.png");
{
SaveFileDialog dialog = new SaveFileDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image.Save(@"C:\Documents and Settings\.Png", System.Drawing.Imaging.ImageFormat.Png);
}
}
}