Final revision
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@ using System.Windows.Forms;
|
||||
|
||||
namespace ScreenCaptureApp
|
||||
{
|
||||
public sealed class ScreenCaptureForm : Form
|
||||
public partial class ScreenCaptureForm : Form
|
||||
{
|
||||
private Point _startPoint;
|
||||
private Point _endPoint;
|
||||
@@ -46,7 +46,7 @@ namespace ScreenCaptureApp
|
||||
Screen.PrimaryScreen.Bounds.Height,
|
||||
PixelFormat.Format32bppArgb);
|
||||
|
||||
using (var g = Graphics.FromImage(_screenBitmap))
|
||||
using (Graphics g = Graphics.FromImage(_screenBitmap))
|
||||
{
|
||||
g.CopyFromScreen(
|
||||
Screen.PrimaryScreen.Bounds.X,
|
||||
@@ -100,10 +100,9 @@ namespace ScreenCaptureApp
|
||||
{
|
||||
if (_isSelecting)
|
||||
{
|
||||
var rect = GetSelectionRectangle();
|
||||
Rectangle rect = GetSelectionRectangle();
|
||||
e.Graphics.DrawRectangle(_selectionPen, rect);
|
||||
|
||||
// Перекрестие для точного выбора
|
||||
e.Graphics.DrawLine(_selectionPen,
|
||||
new Point(rect.X, rect.Y + rect.Height / 2),
|
||||
new Point(rect.X + rect.Width, rect.Y + rect.Height / 2));
|
||||
@@ -137,7 +136,7 @@ namespace ScreenCaptureApp
|
||||
{
|
||||
CapturedImage = new Bitmap(_selectedRegion.Width, _selectedRegion.Height);
|
||||
|
||||
using (var g = Graphics.FromImage(CapturedImage))
|
||||
using (Graphics g = Graphics.FromImage(CapturedImage))
|
||||
{
|
||||
g.DrawImage(_screenBitmap,
|
||||
new Rectangle(0, 0, _selectedRegion.Width, _selectedRegion.Height),
|
||||
|
||||
Reference in New Issue
Block a user