DateTime fileCreationDatetime = DateTime.Now; Bitmap bitmap = new Bitmap(500, 500); Graphics graphics = Graphics.FromImage(bitmap as Image); string fileName = string.Empty; fileName = string.Format("{0}.jpg", fileCreationDatetime.ToString(@"yyyyMMdd") + "_" + fileCreationDatetime.ToString(@"HHmmss")); string filePath = "C:" + "\\Image\\" + Environment.UserName + "\\" + fileCreationDatetime.ToString(@"yyyyMMdd") + "\\"; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } graphics.CopyFromScreen(25, 25, 25, 25, bitmap.Size); bitmap.Save(filePath + fileName, ImageFormat.Jpeg);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)