//创建用户控件
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CutDrawing
{
public partial class Catch : Form
{
public Catch()
{
InitializeComponent();
}
#region 用户变量
//记录鼠标按下坐标,确定绘图起点
private Point DownPoint = Point.Empty;
//截图完成
private bool CatchFinished = false;
//截图开始
private bool CatchStart = false;
//保存原始图像
private Bitmap originBmp;
//保存截图的矩形
private Rectangle CatchRect;
#endregion
private void Catch_Load(object sender, EventArgs e)
{
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
this.Update