using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Tango.RemoteDesktop
{
///
/// Represents a capture rectangle region.
///
public class CaptureRegion
{
///
/// Gets or sets the region left corner.
///
public int Left { get; set; }
///
/// Gets or sets the region top corner.
///
public int Top { get; set; }
///
/// Gets or sets the region width.
///
public int Width { get; set; }
///
/// Gets or sets the region height.
///
public int Height { get; set; }
///
/// Initializes a new instance of the class.
///
public CaptureRegion()
{
}
///
/// Initializes a new instance of the class using a object.
///
/// The rectangle..
public CaptureRegion(Rectangle rect)
{
Left = rect.Left;
Top = rect.Top;
Width = rect.Width;
Height = rect.Height;
}
///
/// Initializes a new instance of the class using a object.
///
/// The rectangle.
public CaptureRegion(Rect rect)
{
Left = (int)rect.Left;
Top = (int)rect.Top;
Width = (int)rect.Width;
Height = (int)rect.Height;
}
///
/// Initializes a new instance of the class.
///
/// The left.
/// The top.
/// The width.
/// The height.
public CaptureRegion(int left, int top, int width, int height)
{
Left = left;
Top = top;
Width = width;
Height = height;
}
///
/// Creates a capture region from by the bounds of the primary screen.
///
///
public static CaptureRegion PrimaryScreenBounds()
{
return new CaptureRegion(System.Windows.Forms.Screen.PrimaryScreen.Bounds);
}
///
/// Returns a that represents this instance.
///
///
/// A that represents this instance.
///
public override string ToString()
{
return $"X: {Left}, Y: {Top}, W: {Width}, H: {Height}";
}
}
}