Пример #1
0
        public string Capture(int x1, int y1, int x2, int y2, string name = "")
        {
            if (string.IsNullOrEmpty(user.ID))
            {
                name = user.ID;
            }
            string path = string.Format("{0}/{1}.bmp", folder_capture, name);

            dm.Capture(x1, y1, x2, y2, path);
            return(path);
        }
Пример #2
0
        private void ctrl_capture_Click(object sender, EventArgs e)
        {
            var p1     = getPoint(ctrl_start_pos.Text);
            var p2     = getPoint(ctrl_end_pos.Text);
            var folder = "captures";

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
            var path = folder + "/" + DateTime.Now.Ticks + ".bmp";
            var r    = dm.Capture(Math.Min(p1.X, p2.X), Math.Min(p1.Y, p2.Y), Math.Max(p1.X, p2.X), Math.Max(p1.Y, p2.Y), path);

            if (r == 1)
            {
                AddLog("截图保存于 " + path);
            }
            else
            {
                AddLog("截图保存失败");
            }
        }