Ejemplo n.º 1
0
        private void canvas左邊手寫畫板_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            最後繪圖時間 = DateTime.Now;
            手寫物件軌跡_左 = new 手寫物件軌跡()
            {
                StrokeThickness = 使用中的繪圖工具.線條粗細,
                手寫物件調色盤 = 使用中的繪圖工具.手寫物件調色盤,
                手寫物件s = new List<手寫物件>(),
            };

            手寫物件軌跡_左.手或筆與橡皮擦 = this.使用中的繪圖工具.手或筆與橡皮擦;

            頁面手寫物件軌跡_左.手寫物件軌跡s.Add(手寫物件軌跡_左);
            PreviousContactPoint = e.GetCurrentPoint(this.canvas左邊手寫畫板).Position;

            if (e.GetCurrentPoint(this.canvas左邊手寫畫板).Properties.IsLeftButtonPressed)
            {
                PenID = e.GetCurrentPoint(this.canvas左邊手寫畫板).PointerId;
                e.Handled = true;
                this.正在手寫中 = true;
            }
        }
Ejemplo n.º 2
0
        private void 產生手寫軌跡的測試資料()
        {
            Random random = new Random((int)DateTime.Now.Ticks);
            int 最多手寫次數 = random.Next(5, 20);

            for (int hi = 0; hi < 最多手寫次數; hi++)
            {
                手寫物件軌跡 手寫物件軌跡 = new 手寫物件軌跡();
                int 每次手寫軌跡資料數 = random.Next(100, 1500);
                for (int hj = 0; hj < 每次手寫軌跡資料數; hj++)
                {
                    手寫物件 手寫物件 = new 手寫物件();

                    手寫物件軌跡.手寫物件s.Add(手寫物件);
                }
                頁面手寫物件軌跡_左.手寫物件軌跡s.Add(手寫物件軌跡);
            }


            //foreach (var item in 頁面手寫物件軌跡_左.手寫物件軌跡s)
            //{
            //    foreach (var item1 in item.手寫物件s)
            //    {
            //        Line line = new Line()
            //        {
            //            X1 = item1.X1,
            //            X2 = item1.X2,
            //            Y1 = item1.Y1,
            //            Y2 = item1.Y2,
            //            StrokeThickness = item.StrokeThickness,
            //            Stroke = item.取得手寫物件調色盤的實際SolidColorBrush(),
            //        };
            //        this.canvas右邊手寫畫板.Children.Add(line);

            //    }
            //}
        }