Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-07-07 22:50:04 +07:00
parent ca655c5055
commit c196a30fe0

View File

@@ -49,14 +49,14 @@ namespace ScreenCaptureApp
{ {
using (ResultForm resultForm = new ResultForm(captureForm.CapturedImage)) using (ResultForm resultForm = new ResultForm(captureForm.CapturedImage))
{ {
if (resultForm.ShowDialog() == DialogResult.OK) DialogResult dlgResult = resultForm.ShowDialog();
if (dlgResult == DialogResult.OK)
{ {
using (SaveFileDialog sfd = new SaveFileDialog()) using (SaveFileDialog sfd = new SaveFileDialog())
{ {
sfd.Title = "Сохранить скриншот"; sfd.Title = "Сохранить скриншот";
sfd.Filter = "PNG Image|*.png|JPEG Image|*.jpg|Bitmap Image|*.bmp"; sfd.Filter = "PNG Image|*.png|JPEG Image|*.jpg|Bitmap Image|*.bmp";
sfd.FileName = $"screenshot_{DateTime.Now:dd-MM-yyyy_HH.mm.ss}"; sfd.FileName = $"screenshot_{DateTime.Now:dd-MM-yyyy_HH.mm.ss}";
if (sfd.ShowDialog() == DialogResult.OK) if (sfd.ShowDialog() == DialogResult.OK)
{ {
captureForm.CapturedImage.Save(sfd.FileName, GetImageFormat(sfd.FileName)); captureForm.CapturedImage.Save(sfd.FileName, GetImageFormat(sfd.FileName));
@@ -64,7 +64,7 @@ namespace ScreenCaptureApp
} }
} }
} }
else if (resultForm.DialogResult == DialogResult.Yes) else if (dlgResult == DialogResult.Yes)
{ {
try try
{ {