Update after Final revision
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
26
MainForm.cs
26
MainForm.cs
@@ -21,7 +21,7 @@ namespace ScreenCaptureApp
|
||||
InitializeComponent();
|
||||
if (!RegisterHotKey(this.Handle, PRINT_SCREEN_ID, 0x0, 0x2C))
|
||||
{
|
||||
notifyIcon1.ShowBalloonTip(1000, "Error", "Failed to register Print Screen hotkey", ToolTipIcon.Error);
|
||||
notifyIcon1.ShowBalloonTip(1000, "Ошибка", "Не удалось привязать Print Screen", ToolTipIcon.Error);
|
||||
}
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
@@ -53,14 +53,14 @@ namespace ScreenCaptureApp
|
||||
{
|
||||
using (SaveFileDialog sfd = new SaveFileDialog())
|
||||
{
|
||||
sfd.Title = "Save screenshot";
|
||||
sfd.Title = "Сохранить скриншот";
|
||||
sfd.Filter = "PNG Image|*.png|JPEG Image|*.jpg|Bitmap Image|*.bmp";
|
||||
sfd.FileName = $"screenshot_{DateTime.Now:dd-MM-yyyy_HH.mm.ss}";
|
||||
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
captureForm.CapturedImage.Save(sfd.FileName, GetImageFormat(sfd.FileName));
|
||||
notifyIcon1.ShowBalloonTip(1000, "Success", "Screenshot saved!", ToolTipIcon.Info);
|
||||
notifyIcon1.ShowBalloonTip(1000, "Успех", "Скриншот сохранен!", ToolTipIcon.Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,11 +69,11 @@ namespace ScreenCaptureApp
|
||||
try
|
||||
{
|
||||
Clipboard.SetImage(captureForm.CapturedImage);
|
||||
notifyIcon1.ShowBalloonTip(1000, "Success", "Copied to clipboard!", ToolTipIcon.Info);
|
||||
notifyIcon1.ShowBalloonTip(1000, "Успех", "Скриншот скопирован в буфер обмена!", ToolTipIcon.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
notifyIcon1.ShowBalloonTip(1000, "Error", $"Copy failed: {ex.Message}", ToolTipIcon.Error);
|
||||
notifyIcon1.ShowBalloonTip(1000, "Ошибка", $"Копирование не удалось: {ex.Message}", ToolTipIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,8 +84,7 @@ namespace ScreenCaptureApp
|
||||
|
||||
private System.Drawing.Imaging.ImageFormat GetImageFormat(string fileName)
|
||||
{
|
||||
string ext = System.IO.Path.GetExtension(fileName).ToLower();
|
||||
switch (ext)
|
||||
switch (System.IO.Path.GetExtension(fileName).ToLower())
|
||||
{
|
||||
case ".jpg": return System.Drawing.Imaging.ImageFormat.Jpeg;
|
||||
case ".jpeg": return System.Drawing.Imaging.ImageFormat.Jpeg;
|
||||
@@ -96,7 +95,7 @@ namespace ScreenCaptureApp
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
disablePrintScreenCaptureToolStripMenuItem.Text = $"Print Screen Capture: {(captureOnKeyPress ? "ON" : "OFF")}";
|
||||
toggleHotkeyToolStripMenuItem.Text = $"Отлик на Print Screen: {(captureOnKeyPress ? "ON" : "OFF")}";
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
@@ -125,9 +124,9 @@ namespace ScreenCaptureApp
|
||||
private void toggleHotkeyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
captureOnKeyPress = !captureOnKeyPress;
|
||||
disablePrintScreenCaptureToolStripMenuItem.Text = $"Print Screen Capture: {(captureOnKeyPress ? "ON" : "OFF")}";
|
||||
notifyIcon1.ShowBalloonTip(250, "Screen Capture",
|
||||
captureOnKeyPress ? "Print Screen capture enabled" : "Print Screen capture disabled",
|
||||
toggleHotkeyToolStripMenuItem.Text = $"Отлик на Print Screen: {(captureOnKeyPress ? "ON" : "OFF")}";
|
||||
notifyIcon1.ShowBalloonTip(250, "Захват экрана",
|
||||
captureOnKeyPress ? "Отлик на Print Screen включен" : "Отлик на Print Screen отключен",
|
||||
ToolTipIcon.Info);
|
||||
}
|
||||
|
||||
@@ -136,10 +135,5 @@ namespace ScreenCaptureApp
|
||||
base.OnFormClosing(e as FormClosingEventArgs);
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private void bigButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
CaptureScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user