void OnTouch(object sender, EventArgs e) { string str = e.ToString(); int index = str.IndexOf("X="); string strX = str.Substring(index + 2); index = strX.IndexOf(","); strX = strX.Remove(index); index = str.IndexOf("Y="); string strY = str.Substring(index + 2); index = strY.IndexOf("}"); strY = strY.Remove(index); float X = Convert.ToSingle(strX); float Y = Convert.ToSingle(strY); offsetX += centX - X; if (offsetX > 2000) offsetX = 2000; else if (offsetX < -2000) offsetX = -2000; offsetY += centY - Y; if (!timer.Enabled) { canvasView.InvalidateSurface(); } }
<sk:SKCanvasView x:Name="canvasView" Grid.Row="1" Grid.ColumnSpan="4" PaintSurface="OnCanvasViewPaintSurface" BackgroundColor="Black" EnableTouchEvents="True" Touch="OnTouch"> </sk:SKCanvasView>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)