我想實現我的桌面上this program(其中有一個觸摸屏顯示器),運行Windows Phone模擬器在Visual Studio 2013年現在着墨在Windows的Silverlight 8.1的應用程序
(模擬器8.1 WVGA 4英寸512 MB)我改變了MyIP_MouseLeftButtonDown和MyIP_MouseMove函數來輸出一些調試數據,如下所示:
- :
private void MyIP_MouseLeftButtonDown(object sender, MouseEventArgs e) { MyIP.CaptureMouse(); StylusPointCollection MyStylusPointCollection = new StylusPointCollection(); MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP));// MyIP is required here because it is the object with reference to which we get our stylus point's coordinates NewStroke = new Stroke(MyStylusPointCollection); Debug.WriteLine("Mouse Down"+MyStylusPointCollection.Count); MyIP.Strokes.Add(NewStroke); } private void MyIP_MouseMove(object sender, MouseEventArgs e) { StylusPointCollection MyStylusPointCollection = new StylusPointCollection(); MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP)); Debug.WriteLine("Mouse Move" + MyStylusPointCollection.Count); if (NewStroke != null) NewStroke.StylusPoints.Add(MyStylusPointCollection); }
現在運行該應用時有2種情況
當我用鼠標在畫布上寫字時,在第一筆畫中僅捕獲一個點並且未捕捉到動作。當鼠標按鈕被釋放,然後再次按下以啓動第二次中風時,整個中風都會受到控制。輸出和畫布(附圖)是:
鼠標DOWN1
鼠標Move1
鼠標DOWN1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
當我用我的手指在畫布上寫,整個第一行程被抓獲,然後在第二行程也被抓獲。輸出和帆布(附圖)是:
鼠標DOWN1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標移動1
鼠標移動1
鼠標移動1 < --------第二杆開始
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標Move1
鼠標移動1
鼠標移動1
鼠標移動1
有人能告訴我爲什麼鼠標不能正常工作嗎?