Action6001.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using PaintDotNet.Base;
  2. using PaintDotNet.Data.Param;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace PaintDotNet.Data.Action
  9. {
  10. /// <summary>
  11. ///
  12. /// </summary>
  13. public class Action6001 : ParamObject
  14. {
  15. public override OpenCvSharp.Mat PerformProcess(OpenCvSharp.Mat src)
  16. {
  17. //bool isPixel = false;
  18. //for (int i = 0; i < this.lists.Count; i++)
  19. //{
  20. // Args args = lists[i];
  21. // switch (args.Key)
  22. // {
  23. // case "unit":
  24. // isPixel = args.value.ToString().Equals(PdnResources.GetString("Menu.Pixel.text"));
  25. // break;
  26. // }
  27. //}
  28. //if (isPixel)
  29. //{
  30. //}
  31. return Adjust.AdjustIntent.ResizeMat(src,this.lists);
  32. }
  33. /// <summary>
  34. /// 用于初始化参数
  35. /// </summary>
  36. public Action6001()
  37. {
  38. this.MenuId = ActionType.ImageChangeResolution;
  39. this.OpenImage = "current";
  40. //宽
  41. IntegerNumber stringArray2 = new IntegerNumber(0, 100000);
  42. stringArray2.key = "width";
  43. stringArray2.name = "宽度";
  44. stringArray2.initialValue = 0;
  45. stringArray2.Value = 0;
  46. lists.Add(stringArray2);
  47. //长
  48. IntegerNumber stringArray = new IntegerNumber(0,100000);
  49. stringArray.key = "height";
  50. stringArray.name = "高度";
  51. stringArray.initialValue = 0;
  52. stringArray.Value = 0;
  53. lists.Add(stringArray);
  54. BooleanObject autoThreshold = new BooleanObject();
  55. autoThreshold.key = "lockAspectRatio";
  56. autoThreshold.name = "锁定横纵比";
  57. autoThreshold.initialValue = false;
  58. autoThreshold.value = false;
  59. lists.Add(autoThreshold);
  60. ////单位
  61. StringArray binaryTypeA = new StringArray();
  62. binaryTypeA.key = "unit";
  63. binaryTypeA.name = "单位";
  64. binaryTypeA.initialValue = InvariantData.unitparameters;
  65. binaryTypeA.Value = MeasurementUnit.Pixel;
  66. lists.Add(binaryTypeA);
  67. }
  68. }
  69. }