瀏覽代碼

画板

tags/录制修改前
zhangxueyang 4 年之前
父節點
當前提交
4b3a007e4e

+ 44
- 0
Common/system/BlackboardNew.cs 查看文件

@@ -270,6 +270,50 @@ namespace Common.system
270 270
                     }
271 271
 
272 272
                     m_canvas.Strokes.Add(page.lines.Last().lines_curr);
273
+                    //StylusPoints stylusPoints = new StylusPoints();
274
+                    //stylusPoints.Add();
275
+                    //m_canvas.Strokes[0].StylusPoints.Add();
276
+                    StrokeCollection strokes = new StrokeCollection();
277
+                    StylusPointCollection stylusPoints = new StylusPointCollection();
278
+                    //stylusPoints.
279
+                    //Stroke stroke = new Stroke();
280
+                    System.Windows.Input.StylusPointDescription stylusPointDescription = new StylusPointDescription();
281
+                    StylusPoint stylusPoint = new StylusPoint();
282
+                    stylusPoint.X = 580;
283
+                    stylusPoint.Y = 212;
284
+                    stylusPoints.Add(stylusPoint);
285
+                    Stroke stroke = new Stroke(stylusPoints);
286
+
287
+                    stylusPoint.X = 581;
288
+                    stylusPoint.Y = 213;
289
+                    stylusPoints.Add(stylusPoint);
290
+                     stroke = new Stroke(stylusPoints);
291
+
292
+                    stylusPoint.X = 586;
293
+                    stylusPoint.Y = 214;
294
+                    stylusPoints.Add(stylusPoint);
295
+                    stroke = new Stroke(stylusPoints);
296
+
297
+                    stylusPoint.X = 599;
298
+                    stylusPoint.Y = 214;
299
+                    stylusPoints.Add(stylusPoint);
300
+                    stroke = new Stroke(stylusPoints);
301
+                    stylusPoint.X = 623;
302
+                    stylusPoint.Y = 214;
303
+                    stylusPoints.Add(stylusPoint);
304
+                    stroke = new Stroke(stylusPoints);
305
+
306
+                    stylusPoint.X = 663;
307
+                    stylusPoint.Y = 214;
308
+                    stylusPoints.Add(stylusPoint);
309
+                    stroke = new Stroke(stylusPoints);
310
+                    stylusPoint.X = 963;
311
+                    stylusPoint.Y = 214;
312
+                    stylusPoints.Add(stylusPoint);
313
+                    stroke = new Stroke(stylusPoints);
314
+                    //page.lines.Last().lines_curr.Add();
315
+
316
+                    m_canvas.Strokes.Add(stroke);
273 317
                 }
274 318
             }
275 319
         }

+ 1
- 0
Common/system/LatticeFileHelper.cs 查看文件

@@ -187,6 +187,7 @@ namespace Common.system
187 187
             PrintProcess.StartInfo.Arguments = ContentParameter;
188 188
             PrintProcess.StartInfo.UseShellExecute = false;           //不使用操作系统外壳程序启动
189 189
             PrintProcess.StartInfo.RedirectStandardError = true;      //重定向标准错误输出
190
+            PrintProcess.StartInfo.RedirectStandardOutput = true;
190 191
             PrintProcess.StartInfo.CreateNoWindow = true;             //不显示程序窗口
191 192
             PrintProcess.StartInfo.RedirectStandardInput = true;      //用于模拟该进程控制台的输入
192 193
             //外部程序(这里是FFMPEG)输出流时候产生的事件,这里是把流的处理过程转移到下面的方法中,详细请查阅MSDN

+ 4
- 0
XHWK.WKTool/App.cs 查看文件

@@ -82,6 +82,10 @@ namespace XHWK.WKTool
82 82
         /// </summary>
83 83
         public static string[] JPaths = new string[999];
84 84
         public static string ImgPath = string.Empty;
85
+        /// <summary>
86
+        /// 页码IP
87
+        /// </summary>
88
+        public static string[] OutPut = new string[] { }; 
85 89
         #endregion
86 90
 
87 91
         [STAThread]

+ 1
- 1
XHWK.WKTool/PrintTool/afpsettings.txt 查看文件

@@ -1,6 +1,6 @@
1 1
 <PATHS>
2 2
 <AFPHOME>
3
-E:\项目\测试\Wpf测试\bin\Debug\PrintTool\
3
+E:\项目\下载\DotTool_2.0.1\点阵制作工具\PrintTool\
4 4
 <GhostScript>
5 5
 Ghostscript\gs8.71\bin
6 6
 <ImageMagick>

+ 4
- 3
XHWK.WKTool/XHMicroLessonSystemWindow.xaml 查看文件

@@ -8,7 +8,7 @@
8 8
         xmlns:local="clr-namespace:XHWK.WKTool"
9 9
         mc:Ignorable="d"
10 10
         Title="XHMicroLessonSystemWindow" Height="930" Width="1162.5" WindowStartupLocation="CenterOwner"
11
-    WindowStyle="None" Background="#EFF1F8"  
11
+    WindowStyle="None" Background="#EFF1F8"   AllowsTransparency="True" 
12 12
     ShowInTaskbar="False">
13 13
     <Viewbox>
14 14
         <Grid Height="930" Width="1162.5">
@@ -149,9 +149,10 @@
149 149
                 </Grid>
150 150
                 <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
151 151
                 <!--摄像头-->
152
-                <wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
152
+                <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
153 153
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
154
-                </wfi:WindowsFormsHost>
154
+                </wfi:WindowsFormsHost>-->
155
+                <Image x:Name="imgPlayer" Width="172" Height="124"  HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top"/>
155 156
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Right"
156 157
             Height="58" Margin="0,718,50,0" Grid.Column="1">
157 158
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"

+ 74
- 7
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -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
         /// 我的

Loading…
取消
儲存