소스 검색

添加项目文件。

CrazyIter 5 년 전
부모
커밋
21d6552259

+ 13 - 0
HTEXLib/Builders/HtexBuilder.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib.Builders
+{
+    public class HtexBuilder
+    {
+        public bool online { get; set; }
+        public string path { get; set; }
+        public string upload { get; set; }
+    }
+}

+ 9 - 0
HTEXLib/HTEXLib.csproj

@@ -0,0 +1,9 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+  </PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
+    <PackageReference Include="System.Drawing.Common" Version="4.7.0" />
+  </ItemGroup>
+</Project>

+ 453 - 0
HTEXLib/Helpers/ColorHelpers/ColorConverter.cs

@@ -0,0 +1,453 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+
+namespace HTEXLib
+{
+    public class ColorConverter
+    {
+        public string SetLuminanceMod(string s, double luminance)
+        {
+
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try {
+                return SetLuminanceMod(c, luminance);
+            } catch (Exception e) {
+                return s;
+            }
+            
+        }
+        public string SetLuminanceOff(string s, double luminance)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetLuminanceOff(c, luminance);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+            
+        }
+        public string SetTint(string s, double tint)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetTint(c, tint);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+           
+        }
+        public string SetShade(string s, double shade)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetShade(c, shade);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+            
+        }
+        public string SetSaturationMod(string s, double saturation)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetSaturationMod(c, saturation);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+           
+        }
+        public string SetSaturationOff(string s, double saturation)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetSaturationOff(c, saturation);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+          
+        }
+        public string SetBrightness(string s, double luminance)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetBrightness(c, luminance);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+           
+        }
+        public string SetHueMod(string s, double hueMod)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetHueMod(c, hueMod);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+           
+        }
+        public string SetHueOff(string s, double hueOff)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+            try
+            {
+                return SetHueOff(c, hueOff);
+            }
+            catch (Exception e)
+            {
+                return s;
+            }
+           
+        }
+        private double RGB_to_linearRGB(double val)
+        {
+
+            if (val < 0.0)
+                return 0.0;
+            if (val <= 0.04045)
+                return val / 12.92;
+            if (val <= 1.0)
+                return (double)System. Math.Pow(((val + 0.055) / 1.055), 2.4);
+
+            return 1.0;
+        }
+        private double linearRGB_to_RGB(double val)
+        {
+
+            if (val < 0.0)
+                return 0.0;
+            if (val <= 0.0031308)
+                return val * 12.92;
+            if (val < 1.0)
+                return (1.055 * System.Math.Pow(val, (1.0 / 2.4))) - 0.055;
+
+            return 1.0;
+            /*
+            Public Function linearRGB_to_sRGB(ByVal value As Double) As Double
+                If value < 0.0# Then Return 0.0#
+                If value <= 0.0031308# Then Return value * 12.92
+                If value < 1.0# Then Return 1.055 * (value ^ (1.0# / 2.4)) - 0.055
+                Return 1.0#
+            End Function
+            */
+
+        }
+        public string SetShade(Color c, double shade)
+        {
+            //Console.WriteLine("Shade: " + shade);
+
+            double convShade = (shade / 1000) * 0.01;
+
+            double r = (double)c.R / 255;
+            double g = (double)c.G / 255;
+            double b = (double)c.B / 255;
+
+            double rLin = RGB_to_linearRGB(r);
+            double gLin = RGB_to_linearRGB(g);
+            double bLin = RGB_to_linearRGB(b);
+
+            //Console.WriteLine("Linear R: " + rLin + "\nLinear G: " + gLin + "\nLinear B: " + bLin);
+
+            //SHADE 
+            if ((rLin * convShade) < 0)
+                rLin = 0;
+            if ((rLin * convShade) > 1)
+                rLin = 0;
+            else
+                rLin *= convShade;
+
+            if ((gLin * convShade) < 0)
+                gLin = 0;
+            if ((gLin * convShade) > 1)
+                gLin = 0;
+            else
+                gLin *= convShade;
+
+            if ((bLin * convShade) < 0)
+                bLin = 0;
+            if ((bLin * convShade) > 1)
+                bLin = 0;
+            else
+                bLin *= convShade;
+
+            //SHADEEND
+
+            r = linearRGB_to_RGB(rLin);
+            g = linearRGB_to_RGB(gLin);
+            b = linearRGB_to_RGB(bLin);
+
+            Color outColor = Color.FromArgb((int)System.Math.Round(r * 255), (int)System.Math.Round(g * 255), (int)System.Math.Round(b * 255));
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+
+        }
+        public string SetTint(Color c, double tint)
+        {
+
+            double tintConv = (tint / 1000) * 0.01;
+
+            double r = (double)c.R / 255;
+            double g = (double)c.G / 255;
+            double b = (double)c.B / 255;
+
+            double rLin = RGB_to_linearRGB(r);
+            double gLin = RGB_to_linearRGB(g);
+            double bLin = RGB_to_linearRGB(b);
+
+            /**TINT**/
+
+            if (tintConv > 0)
+                rLin = (rLin * tintConv) + (1 - tintConv);
+            else
+                rLin = rLin * (1 + tintConv);
+
+            if (tintConv > 0)
+                gLin = (gLin * tintConv) + (1 - tintConv);
+            else
+                gLin = gLin * (1 + tintConv);
+
+            if (tintConv > 0)
+                bLin = (bLin * tintConv) + (1 - tintConv);
+            else
+                bLin = bLin * (1 + tintConv);
+
+            r = linearRGB_to_RGB(rLin);
+            g = linearRGB_to_RGB(gLin);
+            b = linearRGB_to_RGB(bLin);
+
+            Color outColor = Color.FromArgb((int)System.Math.Round(r * 255), (int)System.Math.Round(g * 255), (int)System.Math.Round(b * 255));
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+        }
+        public string SetSaturationMod(Color c, double saturation)
+        {
+            double satMod = (saturation / 1000) * 0.01;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+            hsl.S *= satMod;
+            c = HSL_to_RGB(hsl);
+
+            return c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
+        }
+        public string SetSaturationOff(Color c, double saturation)
+        {
+            double satOff = (saturation / 1000) * 0.01;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+            hsl.S += satOff;
+            c = HSL_to_RGB(hsl);
+
+            return c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
+        }
+        public string SetBrightness(Color c, double brightness)
+        {
+
+            double convBrightness = brightness / 100000;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+
+            hsl.L *= convBrightness;
+            c = HSL_to_RGB(hsl);
+
+            return c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
+        }
+        public string SetLuminanceMod(Color c, double luminance)
+        {
+            double lumMod = (luminance / 1000) * 0.01;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+            hsl.L *= lumMod;
+            Color outColor = HSL_to_RGB(hsl);
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+        }
+        public string SetLuminanceOff(Color c, double luminance)
+        {
+            double lumModOff = (luminance / 1000) * 0.01;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+            hsl.L += lumModOff;
+            Color outColor = HSL_to_RGB(hsl);
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+        }
+        public string SetHueMod(Color c, double hue)
+        {
+
+            double hueMod = (hue / 1000) * 0.01;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+            hsl.H *= hueMod;
+            Color outColor = HSL_to_RGB(hsl);
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+
+        }
+        public string SetHueOff(Color c, double hue)
+        {
+
+            double hueMod = (hue / 1000) * 0.01;
+
+            ColorHSL hsl = RGB_to_HSL(c);
+            hsl.H += hueMod;
+            Color outColor = HSL_to_RGB(hsl);
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+
+        }
+
+        private ColorHSL RGB_to_HSL(Color c)
+        {
+            ColorHSL hsl = new ColorHSL();
+
+            hsl.H = c.GetHue() / 360.0;
+            hsl.L = c.GetBrightness();
+            hsl.S = c.GetSaturation();
+
+            return hsl;
+        }
+        private ColorHSL CreateHSL(int r, int g, int b)
+        {
+            ColorHSL hsl = new ColorHSL();
+ 
+            double R = (double)r / 255;
+            double G = (double)g / 255;
+            double B = (double)b / 255;
+            double max = 0, min = 0;
+            double H = 0, S = 0, L = 0;
+            bool rBool = false, gBool = false, bBool = false;
+
+            //find max
+            if ((R > G) && (R > B))
+            {
+                max = R;
+                rBool = true;
+            }
+            else if ((G > R) && (G > B))
+            {
+                max = G;
+                gBool = true;
+            }
+            else if ((B > G) && (B > R))
+            {
+                max = B;
+                bBool = true;
+            }
+
+            if ((R < G) && (R < B))
+                min = R;
+            else if ((G < R) && (G < B))
+                min = G;
+            else if ((B < G) && (B < R))
+                min = B;
+
+            //set Luminance
+            hsl.L = (min + max) / 2;
+
+            if (min == max)
+            {
+                hsl.S = 0;
+                hsl.H = 0;
+            }
+
+            //set saturation
+            if (hsl.L < 0.5)
+                hsl.S = (max - min) / (max + min);
+            else if (hsl.L > 0.5)
+                hsl.S = (max - min) / (2.0 - max - min);
+
+            if (rBool)
+            {
+                H = ((G - B) / (max - min)) * 60.0;
+                Console.WriteLine("red");
+            }
+            if (gBool)
+            {
+                H = ((2.0 + ((B - R) / (max - min))) * 60.0);
+                Console.WriteLine("green");
+            }
+            if (bBool)
+            {
+                H = (4.0 + (R - G) / (max - min)) * 60.0;
+                Console.WriteLine("blue");
+            }
+
+            if (H < 0)
+                H += 360;
+
+            H = System.Math.Round(H);
+            H = H / 360;
+
+            hsl.H = H;
+
+            return hsl;
+        }
+        private Color HSL_to_RGB(ColorHSL hslColor)
+        {
+
+            double r = 0, g = 0, b = 0;
+            double temp1, temp2;
+
+
+            if (hslColor.L == 0)
+                r = g = b = 0;
+            else
+            {
+                if (hslColor.S == 0)
+                {
+                    r = g = b = hslColor.L;
+                }
+                else
+                {
+                    temp2 = ((hslColor.L <= 0.5) ? hslColor.L * (1.0 + hslColor.S) : hslColor.L + hslColor.S - (hslColor.L * hslColor.S));
+                    temp1 = 2.0 * hslColor.L - temp2;
+
+                    double[] t3 = new double[] { hslColor.H + 1.0 / 3.0, hslColor.H, hslColor.H - 1.0 / 3.0 };
+                    double[] clr = new double[] { 0, 0, 0 };
+                    for (int i = 0; i < 3; i++)
+                    {
+                        if (t3[i] < 0)
+                            t3[i] += 1.0;
+                        if (t3[i] > 1)
+                            t3[i] -= 1.0;
+
+                        if (6.0 * t3[i] < 1.0)
+                            clr[i] = temp1 + (temp2 - temp1) * t3[i] * 6.0;
+                        else if (2.0 * t3[i] < 1.0)
+                            clr[i] = temp2;
+                        else if (3.0 * t3[i] < 2.0)
+                            clr[i] = (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - t3[i]) * 6.0);
+                        else
+                            clr[i] = temp1;
+                    }
+                    r = clr[0];
+                    g = clr[1];
+                    b = clr[2];
+                }
+            }
+            return Color.FromArgb((int)(255 * r), (int)(255 * g), (int)(255 * b));
+        }
+    }
+}

+ 27 - 0
HTEXLib/Helpers/ColorHelpers/ColorHSL.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    /// <summary>
+    /// 类      名:ColorHSL
+    /// 功      能:H 色相 \ S 饱和度(纯度) \ L 亮度 颜色模型 
+    /// </summary>
+    public class ColorHSL
+    {
+        /// <summary>
+        /// 色相
+        /// </summary>
+        public double H { get; set; }
+        /// <summary>
+        /// 饱和度(纯度)
+        /// </summary>
+        public double S { get; set; }
+
+        /// <summary>
+        /// 饱和度
+        /// </summary>
+        public double L { get; set; }
+    }
+}

+ 72 - 0
HTEXLib/Helpers/ColorHelpers/ColorHSV.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    /// <summary>
+    /// 类      名:ColorHSV
+    /// 功      能:H 色相 \ S 饱和度(纯度) \ V 明度 颜色模型 
+    /// </summary>
+    public class ColorHSV
+    {
+        /// <summary>
+        /// 构造方法
+        /// </summary>
+        /// <param name="h"></param>
+        /// <param name="s"></param>
+        /// <param name="v"></param>
+        public ColorHSV(int h, int s, int v)
+        {
+            this._h = h;
+            this._s = s;
+            this._v = v;
+        }
+
+        private int _h;
+        private int _s;
+        private int _v;
+
+        /// <summary>
+        /// 色相
+        /// </summary>
+        public int H
+        {
+            get { return this._h; }
+            set
+            {
+                this._h = value;
+                this._h = this._h > 360 ? 360 : this._h;
+                this._h = this._h < 0 ? 0 : this._h;
+            }
+        }
+
+        /// <summary>
+        /// 饱和度(纯度)
+        /// </summary>
+        public int S
+        {
+            get { return this._s; }
+            set
+            {
+                this._s = value;
+                this._s = this._s > 255 ? 255 : this._s;
+                this._s = this._s < 0 ? 0 : this._s;
+            }
+        }
+
+        /// <summary>
+        /// 明度
+        /// </summary>
+        public int V
+        {
+            get { return this._v; }
+            set
+            {
+                this._v = value;
+                this._v = this._v > 255 ? 255 : this._v;
+                this._v = this._v < 0 ? 0 : this._v;
+            }
+        }
+    }
+}

+ 238 - 0
HTEXLib/Helpers/ColorHelpers/ColorHelper.cs

@@ -0,0 +1,238 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+namespace HTEXLib
+{
+    /// <summary>
+    /// 类      名:ColorHelper
+    /// 功      能:提供从RGB到HSV/HSL色彩空间的相互转换
+    /// </summary>
+    public static class ColorHelper
+    {
+        /// <summary>
+        /// RGB转换HSV
+        /// </summary>
+        /// <param name="rgb"></param>
+        /// <returns></returns>
+        public static ColorHSV RgbToHsv(this ColorRGB rgb)
+        {
+            double min, max, tmp, H, S, V;
+            double R = rgb.R * 1.0f / 255, G = rgb.G * 1.0f / 255, B = rgb.B * 1.0f / 255;
+            tmp = System.Math.Min(R, G);
+            min = System.Math.Min(tmp, B);
+            tmp = System.Math.Max(R, G);
+            max = System.Math.Max(tmp, B);
+            // H
+            H = 0;
+            if (max == min)
+            {
+                H = 0;
+            }
+            else if (max == R && G > B)
+            {
+                H = 60 * (G - B) * 1.0f / (max - min) + 0;
+            }
+            else if (max == R && G < B)
+            {
+                H = 60 * (G - B) * 1.0f / (max - min) + 360;
+            }
+            else if (max == G)
+            {
+                H = H = 60 * (B - R) * 1.0f / (max - min) + 120;
+            }
+            else if (max == B)
+            {
+                H = H = 60 * (R - G) * 1.0f / (max - min) + 240;
+            }
+            // S
+            if (max == 0)
+            {
+                S = 0;
+            }
+            else
+            {
+                S = (max - min) * 1.0f / max;
+            }
+            // V
+            V = max;
+            return new ColorHSV((int)H, (int)(S * 255), (int)(V * 255));
+        }
+
+        /// <summary>
+        /// HSV转换RGB
+        /// </summary>
+        /// <param name="hsv"></param>
+        /// <returns></returns>
+        public static ColorRGB HsvToRgb( this ColorHSV hsv)
+        {
+            if (hsv.H == 360) hsv.H = 359; // 360为全黑,原因不明
+            double R = 0f, G = 0f, B = 0f;
+            if (hsv.S == 0)
+            {
+                return new ColorRGB(hsv.V, hsv.V, hsv.V);
+            }
+            double S = hsv.S * 1.0f / 255, V = hsv.V * 1.0f / 255;
+            int H1 = (int)(hsv.H * 1.0f / 60), H = hsv.H;
+            double F = H * 1.0f / 60 - H1;
+            double P = V * (1.0f - S);
+            double Q = V * (1.0f - F * S);
+            double T = V * (1.0f - (1.0f - F) * S);
+            switch (H1)
+            {
+                case 0: R = V; G = T; B = P; break;
+                case 1: R = Q; G = V; B = P; break;
+                case 2: R = P; G = V; B = T; break;
+                case 3: R = P; G = Q; B = V; break;
+                case 4: R = T; G = P; B = V; break;
+                case 5: R = V; G = P; B = Q; break;
+            }
+            R = R * 255;
+            G = G * 255;
+            B = B * 255;
+            while (R > 255) R -= 255;
+            while (R < 0) R += 255;
+            while (G > 255) G -= 255;
+            while (G < 0) G += 255;
+            while (B > 255) B -= 255;
+            while (B < 0) B += 255;
+            return new ColorRGB((int)R, (int)G, (int)B);
+        }
+
+        /// <summary>
+        /// RGB转换HSL
+        /// </summary>
+        /// <param name="rgb"></param>
+        /// <returns></returns>
+        public static ColorHSL RgbToHsl( this ColorRGB rgb)
+        {
+            double min, max, tmp, H = 0, S = 0, L = 0;
+            double R = rgb.R * 1.0f / 255, G = rgb.G * 1.0f / 255, B = rgb.B * 1.0f / 255;
+            tmp = System.Math.Min(R, G);
+            min = System.Math.Min(tmp, B);
+            tmp = System.Math.Max(R, G);
+            max = System.Math.Max(tmp, B);
+            L = (max + min) / 2.0d;
+            if (min == max)
+            {
+                H = S = 0;
+            }
+            else
+            {
+                double d = max - min;
+                S = L > 0.5 ? d / (2 - max - min) : d / (max + min);
+                if (max == R)
+                {
+                    H = (G - B) / d + (G < B ? 6 : 0);
+                }
+                else if (max == G)
+                {
+                    H = (G - R) / d + 2;
+                }
+                else if (max == B)
+                {
+                    H = (R - G) / d + 4;
+                }
+            }
+            H = H / 6.0F;
+            return new ColorHSL() { H = H, S = S, L = L };
+        }
+
+        public static double hue2rgb(double p, double q, double t)
+        {
+            if (t < 0) t += 1;
+
+            if (t > 1) t -= 1;
+
+            if (t < 1.0 / 6.0d) return p + (q - p) * 6 * t;
+
+            if (t < 1.0 / 2.0d) return q;
+
+            if (t < 2.0 / 3.0d) return p + (q - p) * (2.0d / 3.0d - t) * 6.0d;
+
+            return p;
+        }
+
+        /// <summary>
+        /// HSL转换RGB
+        /// </summary>
+        /// <param name="hsl"></param>
+        /// <returns></returns>
+        public static ColorRGB HslToRgb( this ColorHSL hsl)
+        {
+            var l = hsl.L;
+            var s = hsl.S;
+            var h = hsl.H;
+            double R = 0, G = 0, B = 0;
+            if (hsl.S == 0)
+            {
+                R = G = B = hsl.L;
+            }
+            else
+            {
+                var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+                var p = 2 * l - q;
+                R = hue2rgb(p, q, h + 1.0d / 3.0d);
+                G = hue2rgb(p, q, h);
+                B = hue2rgb(p, q, h - 1.0d / 3.0d);
+            }
+            R = R * 255; G = G * 255; B = B * 255;
+            return new ColorRGB(int.Parse(System.Math.Round(R, 0) + ""), int.Parse(System.Math.Round(G, 0) + ""), int.Parse(System.Math.Round(B, 0) + ""));
+        }
+        private static double HueToRGB(double p, double q, double h)
+        {
+            if (h < 0) h += 1;
+            if (h > 1) h -= 1;
+            if (6 * h < 1)
+            {
+                return p + ((q - p) * 6 * h);
+            }
+            if (2 * h < 1)
+            {
+                return q;
+            }
+            if (3 * h < 2)
+            {
+                return p + ((q - p) * 6 * ((2.0f / 3.0f) - h));
+            }
+            return p;
+        }
+        /// <summary>
+        /// 处理图像饱和度
+        /// </summary>
+        /// <param name="color"></param>
+        /// <param name="lumMod"></param>
+        /// <param name="lumOff"></param>
+        /// <returns></returns>
+        public static string GetColorLumModAndLumOff(Color color, int lumMod = 0, int lumOff = 0)
+        {
+            ColorHSL colorHSL = RgbToHsl(new ColorRGB(color.R, color.G, color.B));
+            colorHSL.L = colorHSL.L * lumMod / 100_000.0 + lumOff / 100_000.0;
+            ColorRGB colorRGB = HslToRgb(colorHSL);
+            return ColorTranslator.ToHtml(Color.FromArgb(colorRGB.R, colorRGB.G, colorRGB.B)).Replace("#","");
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="color">原色RGB</param>
+        /// <param name="pa">混合原色占百分比/100% </param>
+        /// <param name="Type">Shade 与黑色混合  Tint与白色混合</param>
+        /// <returns></returns>
+        public static string  GetShadeOrTintColor(Color color, double val, string Type)
+        {
+            ColorConverter converter = new ColorConverter();
+            if (Type.Equals("Shade"))
+            {
+                return converter.SetShade(color, val);
+            }
+            else if (Type.Equals("Tint"))
+            {
+                return converter.SetTint(color, val);
+            }
+            else { return ColorTranslator.ToHtml(color).Replace("#",""); }
+        }
+
+    }
+}

+ 83 - 0
HTEXLib/Helpers/ColorHelpers/ColorRGB.cs

@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+namespace HTEXLib
+{
+    /// <summary>
+    /// 类      名:ColorRGB
+    /// 功      能:R 红色 \ G 绿色 \ B 蓝色 颜色模型
+    ///                 所有颜色模型的基类,RGB是用于输出到屏幕的颜色模式,所以所有模型都将转换成RGB输出
+    /// </summary>
+    public class ColorRGB
+    {
+        /// <summary>
+        /// 构造方法
+        /// </summary>
+        /// <param name="r"></param>
+        /// <param name="g"></param>
+        /// <param name="b"></param>
+        public ColorRGB(int r, int g, int b)
+        {
+            this._r = r;
+            this._g = g;
+            this._b = b;
+        }
+
+        private int _r;
+        private int _g;
+        private int _b;
+
+        /// <summary>
+        /// 红色
+        /// </summary>
+        public int R
+        {
+            get { return this._r; }
+            set
+            {
+                this._r = value;
+                this._r = this._r > 255 ? 255 : this._r;
+                this._r = this._r < 0 ? 0 : this._r;
+            }
+        }
+
+        /// <summary>
+        /// 绿色
+        /// </summary>
+        public int G
+        {
+            get { return this._g; }
+            set
+            {
+                this._g = value;
+                this._g = this._g > 255 ? 255 : this._g;
+                this._g = this._g < 0 ? 0 : this._g;
+            }
+        }
+
+        /// <summary>
+        /// 蓝色
+        /// </summary>
+        public int B
+        {
+            get { return this._b; }
+            set
+            {
+                this._b = value;
+                this._b = this._b > 255 ? 255 : this._b;
+                this._b = this._b < 0 ? 0 : this._b;
+            }
+        }
+
+        /// <summary>
+        /// 获取实际颜色
+        /// </summary>
+        /// <returns></returns>
+        public Color GetColor()
+        {
+            return Color.FromArgb(this._r, this._g, this._b);
+        }
+    } 
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1080 - 0
HTEXLib/Helpers/ShapeHelpers/ShapeHelper.cs


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 11119 - 0
HTEXLib/Helpers/ShapeHelpers/ShapeSvg.cs


+ 19 - 0
HTEXLib/Models/Border.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public  class Border
+    {
+
+        public double width { get; set; }
+        public string color { get; set; }
+        public string type { get; set; }
+        /// <summary>
+        /// 描边
+        /// </summary>
+        public string stroke{ get; set; }
+        public string dir { get; set; }
+    }
+}

+ 14 - 0
HTEXLib/Models/Brush.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Brush
+    {
+        public string type { get; set; }
+        public FillStyle fill { get; set; }
+        public string size { get; set; }
+
+    }
+}

+ 173 - 0
HTEXLib/Models/Chart.cs

@@ -0,0 +1,173 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public   class Chart : Item
+    {
+        public  List<CommonChart> charts { get; set; }
+        public List<Paragraph> title { get; set; }
+    }
+
+    public abstract class CommonChart {
+        /// <summary>
+        ///  bar col line pie area scatter radar plotAreaRegion stock surface
+        /// </summary>
+        public string chartType { get; set; }
+        public List<Dictionary<string, object>> datas {get;set;}
+    }
+
+    /// <summary>
+    /// surface3DChart
+    ///     三维曲面图  wireframe=0
+    ///     三维线框曲面图 wireframe=1
+    ///  surfaceChart
+    ///     曲面图  wireframe=0
+    ///     曲面图-俯视框架图  wireframe=1
+    /// </summary>
+    public class SurfaceChart : CommonChart
+    {
+        public string surfaceType { get; set; }
+        public bool is3D { get; set; }
+    }
+    /// <summary>
+    /// stockChart
+    ///     股价图 
+    ///         盘高-盘低-收盘
+    ///         开盘-盘高-盘低-收盘
+    ///         成交量-盘高-盘低-收盘
+    ///         成交量-开盘-盘高-盘低-收盘
+    /// </summary>
+    public class StockChart : CommonChart
+    {
+        public string stockType { get; set; }
+    }
+    /// <summary>
+    /// plotAreaRegion
+    ///     旭日图 sunburst  
+    ///     树状图 treemap
+    ///     直方图 排列图 clusteredColumn
+    ///     箱型图 boxWhisker
+    ///     瀑布图 waterfall
+    /// </summary>
+    public class PlotAreaChart : CommonChart
+    {
+        public string plotAreaType { get;set;}
+    }
+    /// <summary>
+    ///  type radar
+    ///  radarChart  
+    ///     雷达图 
+    ///     带数据标记的雷达图<c:radarStyle val="marker"/>
+    ///     填充雷达图 <c:radarStyle val="filled"/>
+    /// </summary>
+    public class RadarChart : CommonChart
+    {
+        public string radarType { get; set; }
+    }
+    /// <summary>
+    /// type scatter
+    ///  scatterChart
+    ///     散点图 <c:scatterStyle val="lineMarker"/>
+    ///     带直线的散点图 <c:scatterStyle val="lineMarker"/>
+    ///     带直线和数据标记的散点图 <c:scatterStyle val="lineMarker"/>
+    ///     
+    ///     带平滑线和数据标记的散点图 <c:scatterStyle val="smoothMarker"/>
+    ///     带平滑线的散点图<c:scatterStyle val="smoothMarker"/>
+    ///  bubbleChart 气泡图   三维气泡图
+    /// </summary>
+    public class ScatterChart : CommonChart
+    {
+        public string scatterType { get; set; }
+       // public bool Is3D { get; set; }
+    }
+    /// <summary>
+    /// type area
+    /// areaChart
+    ///     面积图 standard
+    ///     堆积面积图 stacked
+    ///     百分比堆积面积图 percentStacked
+    /// area3DChart
+    ///     三维面积图 standard
+    ///     三维堆积面积图 stacked
+    ///     三维百分比堆积面积图 percentStacked
+    /// </summary>
+    public class AreaChart : CommonChart
+    {
+        public string areaType { get; set; }
+        public bool is3D { get; set; }
+    }
+    /// <summary>
+    /// type bar  条形图<c:barDir val="bar"/>   
+    ///  barChart
+    ///     簇状条形图 clustered
+    ///     堆积条形图 stacked
+    ///     百分比堆积条形图 percentStacked
+    ///  bar3DChart
+    ///     三维堆积条形图 stacked
+    ///     三维簇状条形图 clustered
+    ///     三维百分比堆积条形图 percentStacked
+    /// </summary>
+    public class BarChart : CommonChart
+    {
+        public string barType { get; set; }
+        public bool is3D { get; set; }
+    }
+    /// <summary>
+    ///  type bar  柱状图<c:barDir val="col"/>
+    ///  barChart
+    ///     簇状柱形图 clustered
+    ///     堆积柱形图 stacked
+    ///     百分比堆积柱形图 percentStacked
+    ///  bar3DChart
+    ///     三维堆积柱形图 stacked
+    ///     三维簇状柱形图 clustered
+    ///     三维百分比堆积柱形图 percentStacked
+    ///     三维柱形图 standard
+    /// </summary>
+    public class ColChart : CommonChart
+    {
+        public string colType { get; set; }
+        public bool is3D { get; set; }
+    }
+    /// <summary>
+    /// type line   
+    ///  lineChart
+    ///  合并
+    ///     折线图 standard
+    ///     带数据标记的折线图 standard 
+    ///  合并
+    ///     堆积折线图 stacked
+    ///     带标记的堆积折线图 stacked  <c:layout>不为空
+    ///  合并 
+    ///     百分比堆积折线图 percentStacked
+    ///     带数据标记的百分比堆积折线图 percentStacked
+    ///  line3DChart
+    ///     三维折线图 standard
+    /// </summary>
+    public class LineChart : CommonChart
+    {
+        public string lineType { get; set; }
+        public bool is3D { get; set; }
+    }
+    
+    /// <summary>
+    ///   type pie
+    ///  pieChart
+    ///     饼图  不包含   
+    ///  ofPieChart
+    ///     子母饼图   包含<c:ofPieType val="pie"/> 且val为 pie
+    ///     复合条饼图 包含<c:ofPieType val="bar"/> 且val为 bar
+    ///  pie3DChart
+    ///     三维饼图
+    ///  doughnutChart
+    ///     圆环饼图
+    /// </summary>
+    public class PieChart : CommonChart
+    {
+        public string pieType { get; set; }
+        public bool is3D { get; set; }
+    }
+
+}

+ 20 - 0
HTEXLib/Models/Connector.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+
+    public class Connector : Item
+    {
+        
+        /// <summary>
+        ///连接线 p:cxnSp
+        /// </summary>
+        public string cxnType { get; set; }
+        //public string HeadEnd { get; set; }
+        //public string TailEnd { get; set; }
+        public Border border { get; set; }
+      
+    }
+}

+ 11 - 0
HTEXLib/Models/Diagram.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Diagram :Item
+    {
+        public List<Item> shapes { get; set; }
+    }
+}

+ 91 - 0
HTEXLib/Models/ExamItem.cs

@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class ExamItem 
+    {
+        public int? ttl { get; set; }
+        public ExamItem()
+        {
+            children = new List<ExamItem>();
+            option = new List<CodeValue>();
+            answer = new List<string>();
+            points = new List<string>();
+            gradeCode = new List<string>();
+        }
+        public string shaCode { get; set; }
+        //题干
+        public string question { get; set; }
+        // 选项 单选 多选 判断
+        public List<CodeValue> option { get; set; }
+        public List<string> answer { get; set; }
+        //解析
+        public string explain { get; set; }
+        /// <summary>
+        /// 题型  Single单选,Multiple多选,Judge判断,Complete填空,Subjective问答,Compose综合
+        /// </summary>
+        public string type { get; set; }
+        /// <summary>
+        /// 上级shaCode
+        /// </summary>
+        public string pShaCode { get; set; }
+        //管理知识点
+        public List<string> points { get; set; }
+        //认知层次 应用 综合 理解 评鉴 知识
+        public string field { get; set; }
+        public List<ExamItem> children { get; set; }
+        // 配分  
+        public double score { get; set; }
+        /// <summary>
+        /// 题号
+        /// </summary>
+        public int order { get; set; }
+        //补救
+        public string repair { get; set; }
+        /// <summary>
+        /// 来源编码  个人 学校
+        /// </summary>
+        public string scopeCode { get; set; }
+
+
+        public string subjectCode { get; set; }
+        public string periodCode { get; set; }
+        public List<string> gradeCode { get; set; }
+        /// <summary>
+        /// 学段
+        /// </summary>
+       // public string period { get; set; }
+        /// <summary>
+        /// 年级
+        /// </summary>
+      //  public List<string> grade { get; set; }
+        /// <summary>
+        /// 难度
+        /// </summary>
+        public int level { get; set; }
+        public string id { get; set; }
+        /// <summary>
+        /// 科目
+        /// </summary>
+      //  public string subject { get; set; }
+        /// <summary>
+        /// 是否综合题的小题
+        /// </summary>
+        public bool lite { get; set; } = false;
+
+        //创建时间 
+        public long createTime { get; set; }
+        //创建者
+        public string creator { get; set; }
+        //使用次数
+        public int usageCount { get; set; }
+        public string examCode { get; set; }
+    }
+    public class CodeValue
+    {
+        public string code { get; set; }
+        public string value { get; set; }
+    }
+}

+ 51 - 0
HTEXLib/Models/Fill.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Fill
+    {
+
+        public Fill() {
+            grad = new List<string>();
+        }
+        /// <summary>
+        /// [a:noFill, solidFill, gradFill, blipFill, pattFill,        grpFill]
+        ///0,无填充 1.纯色填充 2.渐变填充 3.图片或纹理填充 4.图案填充
+        /// </summary>
+        public int type { get; set; }
+        public string color { get; set; }
+        public string image { get; set; }
+        public FillStyle style { get; set; }
+        //[Newtonsoft.Json.JsonIgnore]
+        //[System.Text.Json.Serialization.JsonIgnore]
+        //public string SvgText { get; set; }
+        //[Newtonsoft.Json.JsonIgnore]
+        //[System.Text.Json.Serialization.JsonIgnore]
+        //public string HtmlText { get; set; }
+        //渐变填充投射方向
+        public double rot { get; set; }
+        //渐变填充  以及前景色 背景色 的图案填充  颜色列表
+        public List<string> grad { get; set; }
+        /// <summary>
+        /// 图案填充的内置图形 ltDnDiag 等 48种内置图案
+        /// </summary>
+        public string patt { get; set; }
+        /// <summary>
+        /// 不透明度
+        /// </summary>
+        public double opacity { get; set; }
+
+    }
+    /// <summary>
+    /// 填充图片偏移量px
+    /// </summary>
+    public class FillStyle {
+        public int left { get; set; } = 0;
+        public int top { get; set; } = 0;
+        public int right { get; set; } = 0;
+        public int bottom { get; set; } = 0;
+    }
+
+}

+ 25 - 0
HTEXLib/Models/FontStyle.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public  class FontStyle
+    {
+        /// <summary>
+        /// 
+        /// font-family、font-style、font-weight、font-variant、font-stretch、font-size、font-size-adjust、
+        /// kerning、letter-spacing、word-spacing和text-decoration
+        /// </summary>
+        public string color { get; set; }
+        public double size { get; set; }
+        //inherit  继承父级
+        public string family { get; set; }
+        public string weight { get; set; }
+        public string style { get; set; }
+        public string decoration { get; set; }
+        public string vertAlign { get; set; }
+        public string align { get; set; }
+        public string shadow { get; set; }
+    }
+}

+ 11 - 0
HTEXLib/Models/Group.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public  class Group : Item
+    {
+        public List<Item> shapes { get; set; }
+    }
+}

+ 17 - 0
HTEXLib/Models/Htex.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Htex
+    {
+        ///spTree
+        /// DocumentFormat.OpenXml.Presentation.Shape
+        /// DocumentFormat.OpenXml.Presentation.GroupShape
+        /// DocumentFormat.OpenXml.Presentation.GraphicFrame
+        /// DocumentFormat.OpenXml.Presentation.ConnectionShape
+        /// DocumentFormat.OpenXml.Presentation.Picture
+        /// DocumentFormat.OpenXml.Presentation.ContentPart Office2010
+    }
+}

+ 30 - 0
HTEXLib/Models/Inner/WarpObj.cs

@@ -0,0 +1,30 @@
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace HTEXLib
+{
+    public class WarpObj
+    {
+        public XmlDocument zip { get; set; }
+        public NodesTable slideLayoutTables { get; set; }
+        public NodesTable slideMasterTables { get; set; }
+        public XmlNode slideMasterTextStyles { get; set; }
+        public Dictionary<string, Dictionary<string, string>> slideResObj { get; set; }
+        public Dictionary<string, Dictionary<string, string>> layoutResObj { get; set; }
+        public Dictionary<string, Dictionary<string, string>> masterResObj { get; set; }
+        public XmlNode slideLayoutContent { get; set; }
+        public XmlNode slideMasterContent { get; set; }
+        public XmlNode themeContent { get; set; }
+        public XmlNode tableStyles { get; set; }
+        public Htex htex { get; set; }
+    }
+
+
+}public class NodesTable { 
+    public Dictionary<string, XmlNode> idTable { get; set; }
+    public Dictionary<string, XmlNode> idxTable { get; set; }
+    public Dictionary<string, XmlNode> typeTable { get; set; }
+}

+ 25 - 0
HTEXLib/Models/Item.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public abstract class Item
+    {
+        // Sp  CxnSp Media Group  Table Chart
+        public string type { get; set; }
+        public Position position { get; set; }
+      //  public string Xml { get; set; }
+        public int index { get; set; }
+        public Svg svg { get; set; }
+
+        public string uid { get; set; } = Guid.NewGuid().ToString("N");
+        public Brush brush { get; set; }
+
+        //public Picture Picture { get; set; }
+        //public Shape Shape { get; set; }
+        //public Math Math { get; set; }
+        //public Table Table { get; set; }
+        //public Chart Chart { get; set; }
+    }
+}

+ 17 - 0
HTEXLib/Models/Math.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Math : Item
+    {
+    
+        public string content { get; set; }
+        
+        public Fill fill { get; set; }
+        
+        public Border border { get; set; }
+      
+    }
+}

+ 21 - 0
HTEXLib/Models/Media.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public   class Media : Item
+    {
+        //image 图片 video.视频 audio 音频
+        public string mediaType { get; set; }
+        //视频资源链接
+        public string url { get; set; }
+        //图片或视频音频缩略图链接
+        public string image { get; set; }
+     
+        public Fill fill { get; set; }
+      
+        public Border border { get; set; }
+     
+    }
+}

+ 54 - 0
HTEXLib/Models/Paragraph.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Paragraph
+    {
+         
+        public ParagraphStyle style { get; set; }
+        public Paragraph() {
+            texts = new List<Text>();
+        }
+ 
+        public BuChar buChar { get; set; }
+        public List<Text> texts { get; set; }
+       
+    }
+    public class Text
+    {
+      //  public string StyleSha { get; set; }
+        public string content { get; set; }
+        public string href { get; set; }
+        public bool isbr { get; set; } = false;
+        
+        public FontStyle style { get; set; }
+    }
+
+    public class BuChar {
+        //TYPE_BULPIC  TYPE_NUMERIC TYPE_BULLET  TYPE_NONE  没有图标的 只有缩进
+        public string type{ get; set; }
+        public double left { get; set; }
+        public double riht { get; set; }
+        public string buchar { get; set; }
+        public string typeface { get; set; }
+        public double  size { get; set; }
+        public string @float { get; set; }
+        /// <summary>
+        /// ltr	默认。文本方向从左到右
+        /// rtl	文本方向从右到左。
+        /// inherit	规定应该从父元素继承 direction 属性的值。
+        /// </summary>
+        public string direction { get; set; } = "inherit";
+    }
+
+    public class ParagraphStyle
+    {
+        public string vert { get; set; }
+        // public string LeftMargin { get; set; }
+        public string hori { get; set; }
+        public string writing { get; set; }
+      
+    }
+}

+ 34 - 0
HTEXLib/Models/Position.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Position
+    {
+        //旋转角度
+        public double rot { get; set; } = 0;
+        //水平翻转
+        public int flipH { get; set; } = 0;
+        //垂直翻转
+        public int flipV { get; set; } = 0;
+        //x轴
+        public double x { get; set; } = 0;
+        //y轴
+        public double y { get; set; } = 0;
+        //宽度
+        public double cx { get; set; } = 0;
+        //高度
+        public double cy { get; set; } = 0;
+        ////初始坐标x
+        //public Int64 ChX { get; set; } = 0;
+        ////初始坐标Y
+        //public Int64 ChY { get; set; } = 0;
+        ////拉伸宽度
+        //public Int64 ChCX { get; set; } = 0;
+        ////拉伸高度
+        //public Int64 ChCY { get; set; } = 0;
+        //层级
+      
+    }
+}

+ 121 - 0
HTEXLib/Models/Shape.cs

@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+     public class Shape : Item
+    { 
+        public string shapeType;
+        public List<Paragraph> paragraph { get; set; }
+        public Fill fill { get; set; }
+        public Border border { get; set; }
+       
+        //public List<ShapeGuide> ShapeGuides { get; set; }
+        //public List<Path> Paths { get; set; }
+        //public string BorderSha { get; set; }
+        //public string FillSha { get; set; }
+
+    }
+
+    public class Svg {
+        public string id { get; set; }
+        //public string Width { get; set; }
+        //public string Height { get; set; }
+        //public string Top { get; set; }
+        //public string Left { get; set; }
+        //public string Style { get; set; }
+        public List<SvgShape> svgShape { get; set; }
+        //public string Defs { get; set; }
+      //  public string Transform { get; set; }
+  
+       // public string SvgData { get; set; }
+       
+    }
+
+    public abstract class SvgShape {
+        // rect ,circle ,ellipse ,line ,polygon ,polyline ,path
+        public string type { get; set; }
+       // public string Style { get; set; }
+       // public string Stroke { get; set; }
+        //描边的不透明度
+       // public string StrokeOpacity { get; set; } = "1";
+      //  public string StrokeWidth { get; set; }
+        // 虚线类型描边
+       // public string StrokeDasharray { get; set; }
+       // public string Fill { get; set; }
+        public string transform { get; set; }
+        public string start { get; set; }
+        public string end { get; set; }
+        //填充色的不透明度
+        //  public string FillOpacity { get; set; } = "1";
+    }
+    public class Rect : SvgShape
+    { 
+        //矩形左上角的x位置
+        public string x { get; set; }
+        //矩形左上角的y位置
+        public string y { get; set; }
+        //矩形的宽度
+        public string width { get; set; }
+        //矩形的高度
+        public string height { get; set; }
+        // 圆角的x方位的半径
+        public string rx { get; set; }
+        // 圆角的y方位的半径
+        public string ry { get; set; }
+    }
+    public class Circle : SvgShape
+    {
+        //圆的半径
+        public string r { get; set; }
+        //圆心的x位置
+        public string cx { get; set; }
+        //圆心的y位置
+        public string cy { get; set; }
+    }
+    public class Ellipse : SvgShape
+    {
+        // 椭圆的x方位的半径
+        public string rx { get; set; }
+        // 椭圆的y方位的半径
+        public string ry { get; set; }
+
+        //椭圆的x位置
+        public string cx { get; set; }
+        //椭圆的y位置
+        public string cy { get; set; }
+    }
+    public class Line : SvgShape
+    {
+        //起点的x位置
+        public string x1 { get; set; }
+        //起点的Y位置
+        public string y1 { get; set; }
+        //终点的X位置
+        public string x2 { get; set; }
+        //终点的Y位置
+        public string y2 { get; set; }
+    }
+    public class Polyline : SvgShape
+    {
+        /// <summary>
+        /// 点集数列。每个数字用空白、逗号、终止命令符或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。
+        /// </summary>
+        public string points { get; set; }
+    }
+    public class Polygon : SvgShape
+    {
+        /// <summary>
+        /// 点集数列。每个数字用空白符、逗号、终止命令或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。
+        /// 所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。路径绘制完后闭合图形,所以最终的直线将从位置(2,2)连接到位置(0,0)。
+        /// </summary>
+        public string points { get; set; }
+
+    }
+    public class SvgPath : SvgShape
+    {
+        public string d { get; set; }
+    
+    }
+}

+ 24 - 0
HTEXLib/Models/Slide.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Slide
+    {
+        public List<Item> item { get; set; }
+        public Fill fill { get; set; }
+        public int index { get; set; }
+        //宽度
+        public double width { get; set; }
+        //高度
+        public double height { get; set; }
+        public ExamItem exercise { get; set; }
+        //1 PPTX  2 HTML  来源
+        public int source { get; set; }
+        /// <summary>
+        /// 1默认为普通页面,2为题目
+        /// </summary>
+        public int flag { get; set; } 
+    }
+}

+ 45 - 0
HTEXLib/Models/Table.cs

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HTEXLib
+{
+    public class Table :Item
+    {
+        public Table() {
+            tr = new List<Tr>();
+        }
+        //内容排版方向 左书写 右书写
+        public string dir { get; set; }
+        public string collapse { get; set; } = "collapse";
+       // public Border Border { get; set; }
+       // public Fill Fill { get; set; }
+        public List<Tr> tr { get; set; }
+    }
+
+    public class Tr {
+        public Tr()
+        {
+            td = new List<Td>();
+        }
+       
+        public Fill fill { get; set; }
+        public  double height { get; set; }
+        public List<Td> td { get; set; }
+    
+        public List<Border> borders { get; set; }
+    }
+    public class Td
+    {
+        public double width { get; set; }
+    
+        public Fill fill { get; set; }
+        public int rowspan { get; set; }
+        public int colspan { get; set; }
+
+        public int vmerge { get; set; }
+        public int hmerge { get; set; }
+        public List<Paragraph> paragraphs { get; set; }
+      
+    }
+}

+ 25 - 0
TEAMModelHTEX.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30128.74
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXLib", "HTEXLib\HTEXLib.csproj", "{6E177D38-155F-49D9-A5E8-046E3548BCCF}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{6E177D38-155F-49D9-A5E8-046E3548BCCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6E177D38-155F-49D9-A5E8-046E3548BCCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6E177D38-155F-49D9-A5E8-046E3548BCCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6E177D38-155F-49D9-A5E8-046E3548BCCF}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {FD6A8191-3E55-4FA5-B669-6CB03467C3A7}
+	EndGlobalSection
+EndGlobal