kazelee
2025-05-14 cd92df8b7b383a6a3218f50b3b62264db8332899
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
using HH.WCS.Mobox3.AnGang.AppStart;
 
namespace HH.WCS.Mobox3.AnGang.Devices {
    public class SnapManager {
        private static SnapDevice _snapDevice { get; set; }
        public SnapManager(AppStart.Snap snap) {
            if (_snapDevice == null) {
                _snapDevice = new SnapDevice();
            }
            _snapDevice.LoadInfo(snap);
        }
 
        public static string GetCapturePicturePath() {
            DateTime now = DateTime.Now;
            string path = Settings.CaptureUrl;
            string fileName = string.Format("{0}{1}{2}{3}{4}{5}", now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second) + ".jpg";
            string filePath = path + "\\" + fileName;
 
            if (_snapDevice.SnapPictureToFileOK(ref filePath)) {
                return filePath;
            }
            else {
                return string.Empty;
            }
        }
    }
}