【发布时间】:2013-09-01 12:13:23
【问题描述】:
我的程序有问题。我正在尝试将图像保存在 C# 中,它们会保存,但是当我在计算机上拍摄新照片时它们会覆盖自己。反正有没有像数字一样自动命名它们?例如:
- Image1.jpg
- Image2.jpg
- Image3.jpg
我正在使用 Visual Studio 2012 和 C# 中的编码。这是我使用的一些代码:
private void button3_Click(object sender, EventArgs e)
{
Rectangle form = this.Bounds;
using (Bitmap bitmap = new Bitmap(form.Width, form.Height))
{
using (Graphics graphic =
Graphics.FromImage(bitmap))
{
graphic.CopyFromScreen(form.Location,
Point.Empty, form.Size);
}
bitmap.Save("C:/Users/G73/Desktop/My OVMK Photos//OpenVMK.jpg", ImageFormat.Jpeg);
}
}
【问题讨论】:
-
我正在使用 Visual Basics 2012 和 C# 编码。哇,伙计,他妈的。
-
如果可读性不重要,请使用 guid:stackoverflow.com/questions/4657974/…
标签: c# visual-studio image-processing