2
Answers

how to auto increment image name as 1,2 and so on

Atul Rokade

Atul Rokade

8y
311
1
Hi all,
 
  Iam creating one application where data is save in jpg format with customer name+today datye but problem is when same customer detail im enter previous image is remove i want save data in ajay17-09-2016(1),ajay17-09-2016(2),(3) format 
 
Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(bitmap as Image);
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);
var date = DateTime.Now.ToString("dd-MM-yyyy");
string format = txtname.Text +=date;
bitmap.Save(@"E:\\Project backups\\Medical\\Sales_receipt\\" +format + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
format ="";
this.Close();
Form3 f = new Form3();
f.Show();
 
Answers (2)