コード例 #1
0
        public SKCanvasViewRendererBase()
        {
#if __ANDROID__
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? (float)Context.FromPixels(coord) : coord);
#elif __IOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? coord : coord * Control.ContentScaleFactor);
#elif __MACOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? coord : coord * Control.Window.BackingScaleFactor);
#elif WINDOWS_UWP
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? coord : (float)(coord * Control.Dpi));
#else
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                //coord => Element.IgnorePixelScaling ? coord : (float)(coord * Control.Dpi));
                coord => coord);
#endif
        }
コード例 #2
0
        public SKGLViewRendererBase()
        {
#if __ANDROID__
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord);
#elif __IOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord * Control.ContentScaleFactor);
#elif __MACOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord * Control.Window.BackingScaleFactor);
#elif WINDOWS_UWP
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => (float)(coord * Control.ContentsScale));
#endif
        }
コード例 #3
0
        private void Initialize()
        {
#if __ANDROID__
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? (float)Context.FromPixels(coord) : coord);
#elif __IOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? coord : coord * Control.ContentScaleFactor);
#elif __MACOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? coord : coord * Control.Window.BackingScaleFactor);
#elif WINDOWS_UWP
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? coord : (float)(coord * Control.Dpi));
#elif TIZEN4_0
            touchHandler = new SKTouchHandler(
                args => ((ISKCanvasViewController)Element).OnTouch(args),
                coord => Element.IgnorePixelScaling ? Tizen.ScalingInfo.FromPixel(coord) : coord);
#endif
        }
コード例 #4
0
        private void Initialize()
        {
#if __ANDROID__
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord);
#elif __IOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord * Control.ContentScaleFactor);
#elif __MACOS__
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord * Control.Window.BackingScaleFactor);
#elif WINDOWS_UWP
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => (float)(coord * Control.ContentsScale));
#elif TIZEN4_0
            touchHandler = new SKTouchHandler(
                args => ((ISKGLViewController)Element).OnTouch(args),
                coord => coord);
#endif
        }
コード例 #5
0
 private void Initialize()
 {
     touchHandler = new SKTouchHandler(
         args => ((ISKCanvasViewController)Element).OnTouch(args),
         (x, y) => GetScaledCoord(x, y));
 }
コード例 #6
0
ファイル: SKTouchHandler.cs プロジェクト: ywscr/SkiaSharp
 public MomentumHandler(SKTouchHandler h)
 {
     handler = h;
 }