123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Text;
- namespace HTEXLib
- {
- /// <summary>
- /// 对元素的边框,填充支撑如何
- /// </summary>
- public class Fill
- {
- public Fill() {
- }
- /// <summary>
- /// https://www.cnblogs.com/coco1s/p/8080211.html 图案的前景色 背景色
- /// [a:noFill, solidFill, gradFill, blipFill, pattFill, grpFill]
- ///-1 则说明需要继承ShapeStyle 的LineColor , 0,无填充 1.纯色填充 2.渐变填充 3.图片或纹理填充 4.图案填充
- /// </summary>
- public int? type { get; set; }
- public string solidFill { get; set; }
- public HtexBlipFill blipFill { get; set; }
- public HtexGradientFill gradientFill { get; set; }
- public HtexPattFill pattFill { get; set; }
- //public HtexOutline outline { get; set; }
- //public Border border { get; set; }
- }
- /// <summary>
- /// 3.图片或纹理填充
- /// </summary>
-
- /// <summary>
- /// 3.图片或纹理填充
- /// </summary>
- public class HtexBlipFill {
- public Vector fillRect { get; set; }
- public string url { get; set; }
- /// <summary>
- /// base64,link
- /// </summary>
- // public string urlType { get; set; }
- //public string contentType { get; set; }
- public string dip { get; set; }
- public bool rotWithShape { get; set; } = true;
- public double opacity { get; set; } = 0;
- public HtexTile tile { get; set; }
- }
- public class HtexTile{
- public string algn { get; set; } //Alignment 对齐方式
- public string flip { get; set; }//Tile Flipping 镜像类型
- public double tx { get; set; }//Horizontal Offset 水平偏移量
- public double ty { get; set; }//Vertical Offset 垂直偏移量
- public double sx { get; set; }//Horizontal Ratio 水平刻度
- public double sy { get; set; }//Vertical Ratio 垂直刻度
- }
- public class HtexPattFill {
- /// <summary>
- /// https://www.cnblogs.com/jxsoft/archive/2011/04/01/2001942.html
- /// System.Drawing.Drawing2D.HatchStyle
- /// https://github.com/CXuesong/PrettyReport/blob/1eaf0da8fd419627cfb418a1f7a7e229a543e681/SpreadsheetLightX25/Drawing/SLDrawingTool.cs
- /// 类型 前景色 背景色
- // HatchBrush myHatchBrush = new HatchBrush(HatchStyle.Vertical, Color.Blue, Color.Green);
- /// 图案填充的内置图形 ltDnDiag 等 48种内置图案
- /// </summary>
- public string prst { get; set; }
- /// <summary>
- ///前景色
- /// </summary>
- public string fgClr { get; set; }
- /// <summary>
- /// 背景色
- /// </summary>
- public string bgClr { get; set; }
- public string base64 { get; set; }
- }
- public class HtexGradientFill
- {
- public bool RotateWithShape { get; set; } = true;
- public string flip { get; set; }
- /// <summary>
- /// line 线性 ,path 路径
- /// </summary>
- public string type { get; set; }
- /// <summary>
- /// 颜色色带终结
- /// </summary>
- public List<ColorPosition> colors { get; set; } = new List<ColorPosition>();
- /// <summary>
- /// tileRect TileRectangle (平铺矩形) 右下角是一个矩形
- /// </summary>
- public Vector tileRect { get; set; }
- public LineFill line { get; set; }
- public PathFill path { get; set; }
- }
- public class LineFill
- {
- public double? rot { get; set; }
- public string scaled { get; set; }
- }
- public class PathFill
- {
- /// <summary>
- ///circle
- ///rect
- ///shape
- /// </summary>
- public string pathType { get; set; }
- public Vector fillToRect { get; set; }
- }
- public class ColorPosition
- {
- public string Color { get; set; }
- public double Position { get; set; }
- }
- /// <summary>
- /// 偏移向量
- /// </summary>
- public class Vector
- {
- //四个方向的偏移量,矩形的下边缘。例如50000/1000= 50% ,辐射百分比
- public int? b { get; set; }
- public int? l { get; set; }
- public int? r { get; set; }
- public int? t { get; set; }
- }
- }
|