|
@@ -68,6 +68,337 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
string FontColor = FontReferenceColors(shapeStyle.FontReference, slide);
|
|
|
return new SlideColor { LineColor = LineColor, FillColor = FillColor, EffectColor = EffectColor, FontColor = FontColor };
|
|
|
}
|
|
|
+ public static HTEXLib.Models.HTEX.RunStyle DoRunProperties(TextCharacterPropertiesType shapeProperties, PPTSlide slide, string type, string partForm) {
|
|
|
+ if (shapeProperties == null)
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ //Outline
|
|
|
+ var lnNode = shapeProperties.GetFirstChild<Outline>();
|
|
|
+ Border border = null;
|
|
|
+ if (lnNode != null)
|
|
|
+ {
|
|
|
+ border = DoOutline(lnNode, slide, type);
|
|
|
+ }
|
|
|
+ Fill fill = new Fill() { type = -1 };
|
|
|
+ var gradFill = shapeProperties.GetFirstChild<GradientFill>();
|
|
|
+ if (gradFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 2;
|
|
|
+ fill.gradientFill = DoGradientFill(gradFill, slide);
|
|
|
+ }
|
|
|
+ var noFill = shapeProperties.GetFirstChild<NoFill>();
|
|
|
+ if (noFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 0;
|
|
|
+ }
|
|
|
+ var pattFill = shapeProperties.GetFirstChild<PatternFill>();
|
|
|
+ if (pattFill != null)
|
|
|
+ {
|
|
|
+ HtexPattFill htexPattFill = DoPattFill(pattFill, slide);
|
|
|
+ fill.type = 4;
|
|
|
+ fill.pattFill = htexPattFill;
|
|
|
+ }
|
|
|
+ var solidFill = shapeProperties.GetFirstChild<SolidFill>();
|
|
|
+ if (solidFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 1;
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
+ }
|
|
|
+ var groupFill = shapeProperties.GetFirstChild<GroupFill>();
|
|
|
+ if (groupFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 5;
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
|
|
|
+ if (blipFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 3;
|
|
|
+ fill.blipFill = DoBlipFill(blipFill, slide, partForm);
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ var effect = doEffect(EffectList, slide, partForm);
|
|
|
+ var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
+ var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
|
|
|
+ var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
|
|
|
+ var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
|
|
|
+ return new HTEXLib.Models.HTEX.RunStyle { fill = fill, border = border,effect=effect };
|
|
|
+ }
|
|
|
+
|
|
|
+ public static HTEXLib.Models.HTEX.Effect doEffect(EffectList effectList, PPTSlide slide, string partForm) {
|
|
|
+ if (effectList == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ HTEXLib.Models.HTEX.Effect effect = new Models.HTEX.Effect();
|
|
|
+ if (effectList.Blur != null) {
|
|
|
+ effect.blur = new Models.HTEX.Blur
|
|
|
+ {
|
|
|
+ radius = effectList.Blur.Radius!=null? effectList.Blur.Radius.Value * 1.0 / Globals.px12700 : 0,
|
|
|
+ grow = effectList.Blur.Grow!=null?effectList.Blur.Grow.Value:false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.FillOverlay != null)
|
|
|
+ {
|
|
|
+ Fill fill = DoFillOverlay(effectList.FillOverlay, slide, partForm);
|
|
|
+ if (fill == null || fill.type == -1 || fill.type == 0) {
|
|
|
+ fill = null;
|
|
|
+ }
|
|
|
+ effect.fillOverlay = new Models.HTEX.FillOverlay
|
|
|
+ {
|
|
|
+ fill = fill,
|
|
|
+ blend = effectList.FillOverlay.Blend != null ? effectList.FillOverlay.Blend.Value.ToString() : null
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.Glow != null)
|
|
|
+ {
|
|
|
+ string color = DoEffectColor(slide, effectList.Glow);
|
|
|
+ effect.glow = new Models.HTEX.Glow
|
|
|
+ {
|
|
|
+ color = color,
|
|
|
+ rad= effectList.Glow.Radius!=null?effectList.Glow.Radius.Value * 1.0 / Globals.px12700 : 0
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.InnerShadow != null)
|
|
|
+ {
|
|
|
+ string color = DoEffectColor(slide, effectList.InnerShadow);
|
|
|
+ effect.innerShadow = new Models.HTEX.InnerShadow
|
|
|
+ {
|
|
|
+ color = color,
|
|
|
+ blurRad = effectList.InnerShadow.BlurRadius!=null?effectList.InnerShadow.BlurRadius.Value * 1.0 / Globals.px12700 : 0,
|
|
|
+ dir= effectList.InnerShadow.Direction!=null?effectList.InnerShadow.Direction.Value* 1.0 / 60000 : 0,
|
|
|
+ dist= effectList.InnerShadow.Distance!=null?effectList.InnerShadow.Distance.Value*1.0/Globals.px12700:0
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.OuterShadow != null)
|
|
|
+ {
|
|
|
+ string color = DoEffectColor(slide, effectList.OuterShadow);
|
|
|
+ effect.outerShadow = new Models.HTEX.OuterShadow
|
|
|
+ {
|
|
|
+ color = color,
|
|
|
+ blurRad = effectList.OuterShadow.BlurRadius!=null? effectList.OuterShadow.BlurRadius.Value*1.0/ Globals.px12700 : 0,
|
|
|
+ dir = effectList.OuterShadow.Direction!=null?effectList.OuterShadow.Direction.Value * 1.0 / 60000 : 0,
|
|
|
+ dist = effectList.OuterShadow.Distance!=null?effectList.OuterShadow.Distance.Value * 1.0 / Globals.px12700 : 0,
|
|
|
+ rotWithShape= effectList.OuterShadow.RotateWithShape!=null?effectList.OuterShadow.RotateWithShape.Value:true,
|
|
|
+ algn= effectList.OuterShadow.Alignment!=null? effectList.OuterShadow.Alignment.Value.ToString():null,
|
|
|
+ ky= effectList.OuterShadow.VerticalSkew!=null? effectList.OuterShadow.VerticalSkew.Value:0,
|
|
|
+ sy = effectList.OuterShadow.VerticalRatio!=null? effectList.OuterShadow.VerticalRatio.Value:0,
|
|
|
+ sx= effectList.OuterShadow.HorizontalRatio!=null? effectList.OuterShadow.HorizontalRatio.Value:0,
|
|
|
+ kx= effectList.OuterShadow.HorizontalSkew!=null? effectList.OuterShadow.HorizontalSkew.Value:0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.PresetShadow != null)
|
|
|
+ {
|
|
|
+ string color = DoEffectColor(slide, effectList.PresetShadow);
|
|
|
+ effect.presetShadow = new Models.HTEX.PresetShadow
|
|
|
+ {
|
|
|
+ color = color,
|
|
|
+ dir = effectList.PresetShadow.Direction!=null? effectList.PresetShadow.Direction.Value * 1.0 / 60000 : 0,
|
|
|
+ dist = effectList.PresetShadow.Distance!=null?effectList.PresetShadow.Distance.Value * 1.0 / Globals.px12700 : 0,
|
|
|
+ prst = effectList.PresetShadow.Preset!=null? effectList.PresetShadow.Preset.Value.ToString():null
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.Reflection != null)
|
|
|
+ {
|
|
|
+ effect.reflection = new Models.HTEX.Reflection
|
|
|
+ {
|
|
|
+ dir = effectList.Reflection.Direction!=null ? effectList.Reflection.Direction.Value*1.0/ 60000 : 0,
|
|
|
+ dist = effectList.Reflection.Distance!=null?effectList.Reflection.Distance.Value*1.0/Globals.px12700:0,
|
|
|
+ blurRad = effectList.Reflection.BlurRadius!=null? effectList.Reflection.BlurRadius.Value * 1.0 / Globals.px12700 : 0,
|
|
|
+ rotWithShape = effectList.Reflection.RotateWithShape!=null? effectList.Reflection.RotateWithShape.Value:true,
|
|
|
+ algn = effectList.Reflection.Alignment!=null? effectList.Reflection.Alignment.Value.ToString():null,
|
|
|
+ ky = effectList.Reflection.VerticalSkew!=null?effectList.Reflection.VerticalSkew.Value:0,
|
|
|
+ sy = effectList.Reflection.VerticalRatio!=null? effectList.Reflection.VerticalRatio.Value:0,
|
|
|
+ sx = effectList.Reflection.HorizontalRatio!=null? effectList.Reflection.HorizontalRatio.Value:0,
|
|
|
+ kx = effectList.Reflection.HorizontalSkew!=null? effectList.Reflection.HorizontalSkew.Value:0,
|
|
|
+ stA= effectList.Reflection.StartOpacity!=null?effectList.Reflection.StartOpacity.Value * 1.0 / 100000 : 1,
|
|
|
+ stPos = effectList.Reflection.StartPosition!=null?effectList.Reflection.StartPosition.Value : 0,
|
|
|
+ endA = effectList.Reflection.EndAlpha!=null?effectList.Reflection.EndAlpha.Value:0,
|
|
|
+ endPos = effectList.Reflection.EndPosition!=null?effectList.Reflection.EndPosition.Value*1.0/100000:1,
|
|
|
+ fadeDir = effectList.Reflection.FadeDirection!=null?effectList.Reflection.FadeDirection.Value:0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (effectList.SoftEdge != null)
|
|
|
+ {
|
|
|
+ effect.softEdge = new Models.HTEX.SoftEdge
|
|
|
+ {
|
|
|
+ //12700
|
|
|
+ rad = effectList.SoftEdge.Radius!=null? effectList.SoftEdge.Radius.Value*1.0/Globals.px12700:0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return effect;
|
|
|
+ }
|
|
|
+ private static string DoEffectColor(PPTSlide slide, PresetShadow FillReference)
|
|
|
+ {
|
|
|
+ string color = null;
|
|
|
+ if (FillReference != null)
|
|
|
+ {
|
|
|
+ if (FillReference.RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+ if (FillReference.RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelHex);
|
|
|
+ }
|
|
|
+ if (FillReference.HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.HslColor);
|
|
|
+ }
|
|
|
+ if (FillReference.SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SystemColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SchemeColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.PresetColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return color;
|
|
|
+ }
|
|
|
+ private static string DoEffectColor(PPTSlide slide, OuterShadow FillReference)
|
|
|
+ {
|
|
|
+ string color = null;
|
|
|
+ if (FillReference != null)
|
|
|
+ {
|
|
|
+ if (FillReference.RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+ if (FillReference.RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelHex);
|
|
|
+ }
|
|
|
+ if (FillReference.HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.HslColor);
|
|
|
+ }
|
|
|
+ if (FillReference.SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SystemColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SchemeColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.PresetColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return color;
|
|
|
+ }
|
|
|
+ private static string DoEffectColor(PPTSlide slide, InnerShadow FillReference)
|
|
|
+ {
|
|
|
+ string color = null;
|
|
|
+ if (FillReference != null)
|
|
|
+ {
|
|
|
+ if (FillReference.RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+ if (FillReference.RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelHex);
|
|
|
+ }
|
|
|
+ if (FillReference.HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.HslColor);
|
|
|
+ }
|
|
|
+ if (FillReference.SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SystemColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SchemeColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.PresetColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return color;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static string DoEffectColor(PPTSlide slide, Glow FillReference)
|
|
|
+ {
|
|
|
+ string color = null;
|
|
|
+ if (FillReference != null)
|
|
|
+ {
|
|
|
+ if (FillReference.RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+ if (FillReference.RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelHex);
|
|
|
+ }
|
|
|
+ if (FillReference.HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.HslColor);
|
|
|
+ }
|
|
|
+ if (FillReference.SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SystemColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SchemeColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.PresetColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return color;
|
|
|
+ }
|
|
|
+ public static Fill DoFillOverlay(FillOverlay fillOverlay, PPTSlide slide, string partForm) {
|
|
|
+ Fill fill = new Fill() { type = -1 };
|
|
|
+ var gradFill = fillOverlay.GradientFill;
|
|
|
+ if (gradFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 2;
|
|
|
+ fill.gradientFill = DoGradientFill(gradFill, slide);
|
|
|
+ }
|
|
|
+ var noFill = fillOverlay.NoFill;
|
|
|
+ if (noFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 0;
|
|
|
+ }
|
|
|
+ var pattFill = fillOverlay.PatternFill;
|
|
|
+ if (pattFill != null)
|
|
|
+ {
|
|
|
+ HtexPattFill htexPattFill = DoPattFill(pattFill, slide);
|
|
|
+ fill.type = 4;
|
|
|
+ fill.pattFill = htexPattFill;
|
|
|
+ }
|
|
|
+ var solidFill = fillOverlay.SolidFill;
|
|
|
+ if (solidFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 1;
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
+ }
|
|
|
+ var groupFill = fillOverlay.GroupFill;
|
|
|
+ if (groupFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 5;
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var blipFill = fillOverlay.BlipFill;
|
|
|
+ if (blipFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 3;
|
|
|
+ fill.blipFill = DoBlipFill(blipFill, slide, partForm);
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ return fill;
|
|
|
+ }
|
|
|
public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(DocumentFormat.OpenXml.Drawing.Charts.ShapeProperties shapeProperties, PPTSlide slide, string type, string partForm)
|
|
|
{
|
|
|
if (shapeProperties == null) {
|
|
@@ -119,12 +450,13 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
// fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
}
|
|
|
var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ var effect = doEffect(EffectList, slide,partForm);
|
|
|
var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
|
|
|
var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
|
|
|
var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
|
|
|
// CustomGeometry PresetGeometry TODO
|
|
|
- return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border };
|
|
|
+ return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border, effect=effect };
|
|
|
}
|
|
|
public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(ChartShapeProperties shapeProperties, PPTSlide slide, string type, string partForm,ChartPart chartPart)
|
|
|
{
|
|
@@ -178,12 +510,13 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
// fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
}
|
|
|
var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ Models.HTEX. Effect effect= doEffect(EffectList, slide, partForm);
|
|
|
var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
|
|
|
var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
|
|
|
var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
|
|
|
// CustomGeometry PresetGeometry TODO
|
|
|
- return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border };
|
|
|
+ return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border ,effect= effect };
|
|
|
}
|
|
|
public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(GroupShapeProperties shapeProperties, PPTSlide slide, string type, string partForm)
|
|
|
{
|
|
@@ -233,11 +566,12 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
// fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
}
|
|
|
var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ Models.HTEX.Effect effect = doEffect(EffectList, slide, partForm);
|
|
|
var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
|
|
|
var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
|
|
|
var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
|
|
|
- return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border };
|
|
|
+ return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border ,effect=effect};
|
|
|
}
|
|
|
public static TbStyle DoTableProperties(TableProperties shapeProperties, PPTSlide slide, string type, string partForm)
|
|
|
{
|
|
@@ -294,6 +628,11 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (fill != null )
|
|
|
{
|
|
|
tbStyle.fill = fill;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (tbStyle.fill.type == -1)
|
|
|
+ {
|
|
|
+ tbStyle.fill = null;
|
|
|
}
|
|
|
//TODO
|
|
|
var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
@@ -322,6 +661,10 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
var FillReference = TableBackground.GetFirstChild<FillReference>();
|
|
|
fill= DoFillReference(slide, fill, FillReference);
|
|
|
tbStyle.fill = fill;
|
|
|
+ if (tbStyle.fill.type == -1)
|
|
|
+ {
|
|
|
+ tbStyle.fill = null;
|
|
|
+ }
|
|
|
//TODO
|
|
|
TableBackground.GetFirstChild<EffectPropertiesType>();
|
|
|
TableBackground.GetFirstChild<EffectReference>();
|
|
@@ -756,6 +1099,10 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
var FillReference = TableCellStyle.GetFirstChild<FillReference>();
|
|
|
fill= DoFillReference(slide, fill, FillReference);
|
|
|
cellStyle.fill = fill;
|
|
|
+ if (cellStyle.fill.type == -1)
|
|
|
+ {
|
|
|
+ cellStyle.fill = null;
|
|
|
+ }
|
|
|
//TODO
|
|
|
var Cell3DProperties = TableCellStyle.GetFirstChild<Cell3DProperties>();
|
|
|
}
|
|
@@ -806,6 +1153,10 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
// fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
}
|
|
|
cellStyle.fill = fill;
|
|
|
+ if (cellStyle.fill.type == -1)
|
|
|
+ {
|
|
|
+ cellStyle.fill = null;
|
|
|
+ }
|
|
|
List<CellBorder> cellBorders = new List<CellBorder>();
|
|
|
var LeftBorder = shapeProperties.LeftBorderLineProperties;
|
|
|
if (LeftBorder != null)
|
|
@@ -904,11 +1255,12 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
// fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
}
|
|
|
var EffectList= shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ var effect= doEffect(EffectList, slide, partForm);
|
|
|
var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
|
|
|
var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
|
|
|
var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
|
|
|
- return new HTEXLib.Models.HTEX.ShapeStyle {fill=fill,border= border };
|
|
|
+ return new HTEXLib.Models.HTEX.ShapeStyle {fill=fill,border= border ,effect= effect };
|
|
|
}
|
|
|
public static Fill DoBackgroundProperties(DocumentFormat.OpenXml.Presentation.BackgroundProperties shapeProperties, PPTSlide slide, string partForm)
|
|
|
{
|
|
@@ -1107,7 +1459,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
/// <param name="shapeProperties"></param>
|
|
|
/// <param name="slide"></param>
|
|
|
public static Border DoOutline(DocumentFormat.OpenXml.Drawing.LinePropertiesType outline, PPTSlide slide,string Shapetype) {
|
|
|
- Border border = new Border() {color= new Fill { type=-1} };
|
|
|
+ Border border = new Border() {color= new Fill { type=-1},type="none" };
|
|
|
//20.1.10.35 EMUs. 1 pt = 12700 EMUs.
|
|
|
double? Width = null;
|
|
|
if (outline == null && Shapetype== "CxnSp") {
|
|
@@ -1629,7 +1981,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
{
|
|
|
string FontColor = "";
|
|
|
FontColor = "#" + RgbColorModelHex.Val;
|
|
|
- FontColor = "#" + ShapeHelper.ColorToning(RgbColorModelHex.OuterXml, FontColor.Replace("#", ""));
|
|
|
+ FontColor = "#" + ShapeHelper.ColorToning(RgbColorModelHex.OuterXml, FontColor.Replace("#", "")).Replace("#","");
|
|
|
return FontColor;
|
|
|
}
|
|
|
public static string ReadColor(DocumentFormat.OpenXml.Drawing.RgbColorModelPercentage RgbColorModelPercentage)
|
|
@@ -1641,20 +1993,20 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
var colorFromRGB = System.Drawing.Color.FromArgb(red, green, blue);
|
|
|
string fontcolor = System.Drawing.ColorTranslator.ToHtml(colorFromRGB);
|
|
|
FontColor = fontcolor;
|
|
|
- FontColor = "#" + ShapeHelper.ColorToning(RgbColorModelPercentage.OuterXml, FontColor.Replace("#", ""));
|
|
|
+ FontColor = "#" + ShapeHelper.ColorToning(RgbColorModelPercentage.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
|
|
|
return FontColor;
|
|
|
}
|
|
|
public static string ReadColor(DocumentFormat.OpenXml.Drawing.SystemColor SystemColor, PPTSlide slide)
|
|
|
{
|
|
|
string FontColor = "";
|
|
|
FontColor = "#" + SystemColor.LastColor.Value;
|
|
|
- FontColor = "#" + ShapeHelper.ColorToning(SystemColor.OuterXml, FontColor.Replace("#", ""));
|
|
|
+ FontColor = "#" + ShapeHelper.ColorToning(SystemColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
|
|
|
return FontColor;
|
|
|
}
|
|
|
public static string ReadColor(DocumentFormat.OpenXml.Drawing.SchemeColor SchemeColor,PPTSlide slide) {
|
|
|
string FontColor = "";
|
|
|
FontColor = DoSchemeColor(SchemeColor, slide);
|
|
|
- FontColor = "#" + ShapeHelper.ColorToning(SchemeColor.OuterXml, FontColor.Replace("#", ""));
|
|
|
+ FontColor = "#" + ShapeHelper.ColorToning(SchemeColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
|
|
|
return FontColor;
|
|
|
}
|
|
|
public static string ReadColor(DocumentFormat.OpenXml.Drawing.HslColor HslColor)
|
|
@@ -1665,7 +2017,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
var lum =HslColor.LumValue / 100;
|
|
|
var hsl2rgb = ShapeHelper.HslToRgb(hue, sat, lum);
|
|
|
FontColor = "#" + ShapeHelper.ToHex(hsl2rgb.r) + ShapeHelper.ToHex(hsl2rgb.g) + ShapeHelper.ToHex(hsl2rgb.b);
|
|
|
- FontColor = "#" + ShapeHelper.ColorToning(HslColor.OuterXml, FontColor.Replace("#", ""));
|
|
|
+ FontColor = "#" + ShapeHelper.ColorToning(HslColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
|
|
|
return FontColor;
|
|
|
}
|
|
|
public static string ReadColor(PresetColor PresetColor) {
|
|
@@ -1673,7 +2025,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
//https://m.fontke.com/tool/rgb/0000ff/
|
|
|
//判断是否是拿到名字 还是值
|
|
|
FontColor = ShapeHelper.GetColorName2Hex(PresetColor.Val);
|
|
|
- FontColor = "#" + ShapeHelper.ColorToning(PresetColor.OuterXml, FontColor.Replace("#", ""));
|
|
|
+ FontColor = "#" + ShapeHelper.ColorToning(PresetColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
|
|
|
//TODO
|
|
|
return FontColor;
|
|
|
}
|