You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

1 month ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Windows.Forms;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using ShenTun.Camera.AForgeL;
  9. using ShenTun.Camera.Common;
  10. namespace ShenTun.Camera
  11. {
  12. public class CameraClient
  13. {
  14. public async Task<string> ShowCameraAsync(RequestInterface req)
  15. {
  16. DialogResponse dialogres = new DialogResponse()
  17. {
  18. code = -1,
  19. message="",
  20. };
  21. if (req.PhotoInterface==1)//通用
  22. {
  23. object data;
  24. FrmCamera progressForm = new FrmCamera(req.CapturesTotal,req.CapturesTimes,req.ImageFormat,req.IsAutoConnect);
  25. var progressFormTask = await progressForm.ShowDialogAsync();
  26. try
  27. {
  28. data = progressForm.Result;
  29. }
  30. finally
  31. {
  32. progressForm.Close();
  33. }
  34. dialogres = progressForm.Result;
  35. }
  36. string res= JsonHelper.SerializeObject(dialogres);
  37. return res;
  38. }
  39. }
  40. }