using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows.Forms; using System.Text; using System.Threading.Tasks; using ShenTun.Camera.AForgeL; using ShenTun.Camera.Common; namespace ShenTun.Camera { public class CameraClient { public async Task ShowCameraAsync(RequestInterface req) { DialogResponse dialogres = new DialogResponse() { code = -1, message="", }; if (req.PhotoInterface==1)//通用 { object data; FrmCamera progressForm = new FrmCamera(req.CapturesTotal,req.CapturesTimes,req.ImageFormat,req.IsAutoConnect); var progressFormTask = await progressForm.ShowDialogAsync(); try { data = progressForm.Result; } finally { progressForm.Close(); } dialogres = progressForm.Result; } string res= JsonHelper.SerializeObject(dialogres); return res; } } }