void WriteAlignmentToJson(JsonElementDict item, ImageAlignment alignment) { var docAlignment = item.CreateDict("alignment-insets"); docAlignment.SetInteger("top", alignment.top); docAlignment.SetInteger("bottom", alignment.bottom); docAlignment.SetInteger("left", alignment.left); docAlignment.SetInteger("right", alignment.right); }
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); }