Example #1
0
        void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
        {
            SKImageInfo info    = args.Info;
            SKSurface   surface = args.Surface;
            SKCanvas    canvas  = surface.Canvas;

            SKLattice lattice = new SKLattice();

            lattice.XDivs = new int[] { 100, 400 };
            lattice.YDivs = new int[] { 100, 400 };
            //lattice flags deprecated or removed lattice.Flags = new SKLatticeFlags[9];

            canvas.DrawBitmapLattice(bitmap, lattice, info.Rect);
        }
        void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
        {
            SKImageInfo info    = args.Info;
            SKSurface   surface = args.Surface;
            SKCanvas    canvas  = surface.Canvas;

            canvas.Clear();

            SKLattice lattice = new SKLattice();

            lattice.XDivs = new int[] { 100, 200, 400 };
            lattice.YDivs = new int[] { 100, 300, 400 };

            int count = (lattice.XDivs.Length + 1) * (lattice.YDivs.Length + 1);

            lattice.Flags = new SKLatticeFlags[count];

            canvas.DrawBitmapLattice(bitmap, lattice, info.Rect);
        }