示例#1
0
        void WriteResizingToJson(JsonElementDict item, ImageResizing resizing)
        {
            var docResizing = item.CreateDict("resizing");

            docResizing.SetString("mode", GetSlicingMode(resizing.type));

            var docCenter = docResizing.CreateDict("center");

            docCenter.SetString("mode", GetCenterResizeMode(resizing.centerResizeMode));
            docCenter.SetInteger("width", resizing.centerWidth);
            docCenter.SetInteger("height", resizing.centerHeight);

            var docInsets = docResizing.CreateDict("cap-insets");

            docInsets.SetInteger("top", resizing.top);
            docInsets.SetInteger("bottom", resizing.bottom);
            docInsets.SetInteger("left", resizing.left);
            docInsets.SetInteger("right", resizing.right);
        }
示例#2
0
        public void AddVariant(DeviceRequirement requirement, string path, ImageAlignment alignment, ImageResizing resizing)
        {
            var imageset = new ImageSetVariant(requirement, path);

            imageset.alignment = alignment;
            imageset.resizing  = resizing;
            AddVariant(imageset);
        }