|
@@ -89,7 +89,7 @@ namespace XHWK.WKTool
|
89
|
89
|
drawingAttributes.FitToCurve = true;
|
90
|
90
|
drawingAttributes.IgnorePressure = false;
|
91
|
91
|
blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
|
92
|
|
- wfhCamera.Visibility = Visibility.Hidden;
|
|
92
|
+ //wfhCamera.Visibility = Visibility.Hidden;
|
93
|
93
|
ImgPDFPath = null;
|
94
|
94
|
ImgPDFPath = new string[300];
|
95
|
95
|
}
|
|
@@ -105,6 +105,12 @@ namespace XHWK.WKTool
|
105
|
105
|
{
|
106
|
106
|
DragMove();
|
107
|
107
|
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+ #region 摄像头
|
|
111
|
+ System.Timers.Timer times;
|
|
112
|
+ List<string> RbnOpen;
|
|
113
|
+ bool IsRbnOpen = false;
|
108
|
114
|
/// <summary>
|
109
|
115
|
/// 摄像头打开事件
|
110
|
116
|
/// </summary>
|
|
@@ -118,13 +124,54 @@ namespace XHWK.WKTool
|
118
|
124
|
|
119
|
125
|
|
120
|
126
|
|
121
|
|
- wfhCamera.Visibility = Visibility.Visible;
|
122
|
|
- CameraHelper.IsDisplay = true;
|
123
|
|
- CameraHelper.SourcePlayer = player;
|
|
127
|
+ //wfhCamera.Visibility = Visibility.Visible;
|
|
128
|
+ //CameraHelper.IsDisplay = true;
|
|
129
|
+ //CameraHelper.SourcePlayer = player;
|
124
|
130
|
CameraHelper.UpdateCameraDevices();
|
125
|
131
|
if (CameraHelper.CameraDevices.Count > 0)
|
126
|
132
|
{
|
127
|
133
|
CameraHelper.SetCameraDevice(0);
|
|
134
|
+ //wfhCamera.Visibility = Visibility.Hidden;
|
|
135
|
+ RbnOpen = new List<string>();
|
|
136
|
+ times = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
|
|
137
|
+ times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
|
|
138
|
+ times.Elapsed += new System.Timers.ElapsedEventHandler(Times_Elapsed);
|
|
139
|
+ times.Enabled = true; //启动计时器
|
|
140
|
+
|
|
141
|
+ IsRbnOpen = true;
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+ }
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+ int I = 9999;
|
|
149
|
+ private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
|
150
|
+ {
|
|
151
|
+ if (IsRbnOpen)
|
|
152
|
+ {
|
|
153
|
+ try
|
|
154
|
+ {
|
|
155
|
+ Dispatcher.Invoke(() =>
|
|
156
|
+ {
|
|
157
|
+ if(I>10006)
|
|
158
|
+ {
|
|
159
|
+ //string FilePathName = ImgPath + RsImgName.Count + ".png";
|
|
160
|
+ string path = CameraHelper.CaptureImage(@"G:\103", I.ToString());
|
|
161
|
+ if (!string.IsNullOrWhiteSpace(path))
|
|
162
|
+ {
|
|
163
|
+ RbnOpen.Add(path);
|
|
164
|
+ imgPlayer.Source = new BitmapImage(new Uri(path));
|
|
165
|
+ }
|
|
166
|
+ }
|
|
167
|
+
|
|
168
|
+ I++;
|
|
169
|
+ });
|
|
170
|
+ }
|
|
171
|
+ catch (Exception ex)
|
|
172
|
+ {
|
|
173
|
+ LogHelper.WriteErrLog("【摄像】(Times_Elapsed)生成图片错误:" + ex.Message, ex);
|
|
174
|
+ }
|
128
|
175
|
}
|
129
|
176
|
}
|
130
|
177
|
/// <summary>
|
|
@@ -134,9 +181,11 @@ namespace XHWK.WKTool
|
134
|
181
|
/// <param name="e"></param>
|
135
|
182
|
private void RbnTurnOff_Click(object sender, RoutedEventArgs e)
|
136
|
183
|
{
|
137
|
|
- wfhCamera.Visibility = Visibility.Hidden;
|
|
184
|
+ IsRbnOpen = false;
|
|
185
|
+ //wfhCamera.Visibility = Visibility.Hidden;
|
138
|
186
|
CameraHelper.CloseDevice();
|
139
|
|
- }
|
|
187
|
+ }
|
|
188
|
+ #endregion
|
140
|
189
|
#endregion
|
141
|
190
|
/// <summary>
|
142
|
191
|
/// 录屏事件
|
|
@@ -991,14 +1040,32 @@ namespace XHWK.WKTool
|
991
|
1040
|
//document.Add(p1);
|
992
|
1041
|
}
|
993
|
1042
|
Console.WriteLine("转换成功!");
|
|
1043
|
+ document.Close();
|
994
|
1044
|
}
|
995
|
1045
|
catch (Exception ex)
|
996
|
1046
|
{
|
997
|
1047
|
Console.WriteLine("转换失败,原因:" + ex.Message);
|
998
|
1048
|
}
|
999
|
|
- document.Close();
|
|
1049
|
+ //document.Close();
|
1000
|
1050
|
////Console.ReadKey();
|
1001
|
1051
|
|
|
1052
|
+ int pr = 1;
|
|
1053
|
+ string msg = string.Empty;
|
|
1054
|
+ string outPut = string.Empty;
|
|
1055
|
+ LatticeFileHelper.GeneratingPDF(@"G:\101.pdf", @"G:\102.TPF",out pr, out msg, out outPut);
|
|
1056
|
+ if(pr==0)
|
|
1057
|
+ {
|
|
1058
|
+ outPut = outPut.Replace("[", "").Replace("]","").Replace("\"","").Trim();
|
|
1059
|
+ APP.OutPut = outPut.Split(',');
|
|
1060
|
+ string defa = string.Empty;
|
|
1061
|
+ List<string>defaList= LatticeFileHelper.GetPrinterList(out defa);
|
|
1062
|
+
|
|
1063
|
+ int printResult = 1;
|
|
1064
|
+ string standardError = string.Empty;
|
|
1065
|
+ string standardOutput = string.Empty;
|
|
1066
|
+ LatticeFileHelper.PrinterTPFFile(@"G:\102.TPF",1, /*defa*/"导出为WPS PDF", out printResult,out standardError,out standardOutput);
|
|
1067
|
+
|
|
1068
|
+ }
|
1002
|
1069
|
}
|
1003
|
1070
|
/// <summary>
|
1004
|
1071
|
/// 我的
|