浏览代码

点阵比

tags/录制修改前
zhangxueyang 4 年前
父节点
当前提交
1f70695674
共有 2 个文件被更改,包括 52 次插入35 次删除
  1. 36
    26
      Common/system/BlackboardNew.cs
  2. 16
    9
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 36
- 26
Common/system/BlackboardNew.cs 查看文件

@@ -397,38 +397,48 @@ namespace Common.system
397 397
 
398 398
 
399 399
 
400
-        public void changepages(double _x, double _y, bool _new, Color _color, int _size)
400
+        public void changepages(double _x, double _y, bool _new, Color _color, int _size,int i)
401 401
         {
402
-            if (_new)
402
+            try
403 403
             {
404
-                if (stroke != null && stroke.StylusPoints.Count > 1)
404
+                if (_new)
405 405
                 {
406
-                    drawingAttributes = new DrawingAttributes();
407
-                    //m_canvas.DefaultDrawingAttributes = drawingAttributes;
408
-                    drawingAttributes.Color = _color;
409
-                    drawingAttributes.Width = _size * 5;
410
-                    drawingAttributes.Height = _size * 5;
411
-                    drawingAttributes.FitToCurve = true;
412
-                    drawingAttributes.IgnorePressure = false;
413
-
414
-                    stroke.DrawingAttributes = drawingAttributes;
415
-                    //m_canvas.DefaultDrawingAttributes= drawingAttributes;
416
-                    m_canvas.Strokes.Add(stroke);
417
-                }
406
+                    if (stroke != null && stroke.StylusPoints.Count > 1)
407
+                    {
408
+                        drawingAttributes = new DrawingAttributes();
409
+                        //m_canvas.DefaultDrawingAttributes = drawingAttributes;
410
+                        drawingAttributes.Color = _color;
411
+                        drawingAttributes.Width = _size * 5;
412
+                        drawingAttributes.Height = _size * 5;
413
+                        drawingAttributes.FitToCurve = true;
414
+                        drawingAttributes.IgnorePressure = false;
415
+
416
+                        stroke.DrawingAttributes = drawingAttributes;
417
+                        //m_canvas.DefaultDrawingAttributes= drawingAttributes;
418
+
419
+                        m_canvas.Strokes.Add(stroke);
420
+                        strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
421
+                        stroke = null;
422
+                    }
418 423
 
419
-                stylusPoints = new StylusPointCollection();
420
-                stylusPoint = new StylusPoint();
421
-                //stroke = new Stroke(stylusPoints);
422
-                //stroke = null;
424
+                    stylusPoints = new StylusPointCollection();
425
+                    stylusPoint = new StylusPoint();
426
+                    //stroke = new Stroke(stylusPoints);
427
+                    //stroke = null;
428
+                }
429
+                else
430
+                {
431
+                    //stylusPoints = new StylusPointCollection();
432
+                    //stylusPoint = new StylusPoint();
433
+                    stylusPoint.X = _x;
434
+                    stylusPoint.Y = _y;
435
+                    stylusPoints.Add(stylusPoint);
436
+                    stroke = new Stroke(stylusPoints);
437
+                }
423 438
             }
424
-            else
439
+            catch (Exception ex)
425 440
             {
426
-                //stylusPoints = new StylusPointCollection();
427
-                //stylusPoint = new StylusPoint();
428
-                stylusPoint.X = _x;
429
-                stylusPoint.Y = _y;
430
-                stylusPoints.Add(stylusPoint);
431
-                stroke = new Stroke(stylusPoints);
441
+                LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(changepages)点阵比书写报错:" + ex.Message, ex);
432 442
             }
433 443
         }
434 444
 

+ 16
- 9
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -2097,11 +2097,15 @@ namespace XHWK.WKTool
2097 2097
                 //}
2098 2098
                 stroke.Clear();
2099 2099
             }
2100
-            Dispatcher.Invoke(new Action(() =>
2100
+            if(APP.pageData.currpage>0)
2101 2101
             {
2102
-                //myblackboard.changepages(0, 0, true);
2103
-                myblackboard.changepages(0, 0, true, Color, Size);
2104
-            }));
2102
+                Dispatcher.Invoke(new Action(() =>
2103
+                {
2104
+                    //myblackboard.changepages(0, 0, true);
2105
+                    myblackboard.changepages(0, 0, true, Color, Size, APP.pageData.currpage - 1);
2106
+                }));
2107
+            }
2108
+         
2105 2109
 
2106 2110
         }
2107 2111
 
@@ -2234,12 +2238,15 @@ namespace XHWK.WKTool
2234 2238
                 double testX = (double)cx * PropW;
2235 2239
                 double testY = (double)cy * PropH;
2236 2240
                 //pageSerial //点阵IP地址  与打印的页面关联
2237
-
2238
-                Dispatcher.Invoke(new Action(() =>
2241
+                if(APP.pageData.currpage>0)
2239 2242
                 {
2240
-                    //myblackboard.changepages(testX, testY,false);
2241
-                    myblackboard.changepages(testX, testY, false, Color, Size);
2242
-                }));
2243
+                    Dispatcher.Invoke(new Action(() =>
2244
+                    {
2245
+                        //myblackboard.changepages(testX, testY,false);
2246
+                        myblackboard.changepages(testX, testY, false, Color, Size, APP.pageData.currpage - 1);
2247
+                    }));
2248
+                }
2249
+             
2243 2250
 
2244 2251
 
2245 2252
                 ////每3个点画一条曲线

正在加载...
取消
保存