Ejemplo n.º 1
0
        public NinePatch(TextureSlice tex, int left, int right, int top, int bottom)
        {
            size        = new Point2D(tex.Width, tex.Height);
            patchBounds = Rect.FromLTRB(left, top, right, bottom);
            var textureBounds = new Rect(0, 0, tex.Width, tex.Height);

            patches = SplitToPatches(textureBounds, patchBounds)
                      .Select(x => tex.Slice(x))
                      .ToArray();
        }
Ejemplo n.º 2
0
 public Picture Slice(int x, int y, int w, int h)
 {
     return(new Picture(tex.Slice(x, y, w, h), null));
 }