123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736 |
- using DevExpress.Utils;
- using DevExpress.Utils.Svg;
- using System;
- using System.Collections.Generic;
- using System.Data.SqlTypes;
- using System.Drawing;
- using System.IO;
- using System.IO.Ports;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Xml;
- namespace DxHelper
- {
- public static class SvgHelper
- {
- static readonly Dictionary<string, SvgImage> cache = new Dictionary<string, SvgImage>();
- /// <summary>
- /// 判断color是否为HtmlColor(HtmlColor格式如#A1B2C3)
- /// </summary>
- /// <param name="color"></param>
- /// <returns></returns>
- public static bool IsHtmlColor(string color)
- {
- if (!color.StartsWith("#")) return false;
- if (color.Length != 7) return false;
- string r = color.Substring(1, 2);
- string g = color.Substring(3, 2);
- string b = color.Substring(5, 2);
- bool r1 = byte.TryParse(r, System.Globalization.NumberStyles.HexNumber, null, out _);
- bool r2 = byte.TryParse(g, System.Globalization.NumberStyles.HexNumber, null, out _);
- bool r3 = byte.TryParse(b, System.Globalization.NumberStyles.HexNumber, null, out _);
- return r1 & r2 & r3;
- }
- /// <summary>
- /// 将SvgImage转换为Image对象
- /// </summary>
- /// <param name="svg"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static Image SvgToImage(SvgImage svg, int width, int height)
- {
- var img = svg.Render(new Size(width, height), null, DefaultBoolean.False, DefaultBoolean.False);
- return img;
- }
- /// <summary>
- /// 将文件转换为SvgImage对象
- /// </summary>
- /// <param name="svgFile"></param>
- /// <returns></returns>
- public static SvgImage LoadFromFile(string svgFile)
- {
- return SvgLoader.LoadFromFile(svgFile);
- }
- /// <summary>
- /// 新增图片(➕号)
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateAdd(string color = "#039C23", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M27,14h-9V5c0-0.5-0.5-1-1-1h-2c-0.5,0-1,0.5-1,1v9H5c-0.5,0-1,0.5-1,1v2c0,0.5,0.5,1,1,1h9v9c0,0.5,0.5,1,1,1h2c0.5,0,1-0.5,1-1v-9h9c0.5,0,1-0.5,1-1v-2C28,14.5,27.5,14,27,14z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 编辑图片
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateEdit(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M27.6,8.2l-3.8-3.8c-0.5-0.5-1.4-0.5-1.9,0l-2.5,2.5l5.8,5.8l2.5-2.5C28.1,9.6,28.1,8.8,27.6,8.2z'/>"
- + $"<polygon fill='{color}' points='4,28 9.8,28 4,22.2'/>"
- + $"<rect fill='{color}' x='5.8' y='13.4' transform='matrix(0.707 -0.7072 0.7072 0.707 -8.0721 15.4048)' width='17.6' height='8.2'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 移除图片(➖号)
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateRemove(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M27,18H5c-0.6,0-1-0.5-1-1v-2c0-0.6,0.4-1,1-1h22c0.5,0,1,0.4,1,1v2C28,17.5,27.5,18,27,18z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 创建一个Svg圆.该圆的圆心在ViewBox的中心
- /// </summary>
- /// <param name="colorKey">用于生成颜色的一个key,相同的key具有相同的颜色,当colorKey为html颜色时则使用此颜色(如#A1B2FF)</param>
- /// <param name="opacity">透明度,默认不透明</param>
- /// <param name="viewBoxWidth">视口宽度,默认32px</param>
- /// <param name="viewBoxHeight">视口高度,默认32px</param>
- /// <param name="radius">半径,默认16px</param>
- /// <param name="offsetX">圆心的X轴偏移量,负向左偏移,正向右偏移,默认为0处于视口中心</param>
- /// <returns></returns>
- public static SvgImage CreateCycle(string colorKey, double opacity = 1, int viewBoxWidth = 32, int viewBoxHeight = 32, int radius = 16, double offsetX = 0)
- {
- if (colorKey == null) colorKey = "";
- if (cache.ContainsKey(colorKey))
- return cache[colorKey];
- SvgImage svg = new SvgImage();
- SvgRoot root = SvgRoot.Create(new SvgElementProperties(), viewBox: new SvgViewBox(0, 0, viewBoxWidth, viewBoxHeight));
- svg.Elements.Add(root);
- string colorStr;
- if (IsHtmlColor(colorKey))
- colorStr = colorKey;
- else
- colorStr = ColorHelper.GetHtmlColor(colorKey);
- SvgElementProperties props = new SvgElementProperties
- {
- Fill = colorStr,
- Opacity = opacity//透明度
- };
- SvgCircle circle = SvgCircle.Create(props, viewBoxWidth / 2 + offsetX, viewBoxHeight / 2, radius);
- root.Elements.Add(circle);
- //SvgImage未公开Width和Height属性的公共写入,需要通过以下方式可对width和Size赋值
- MemoryStream ms = new MemoryStream();
- svg.Save(ms);
- svg = ms.ToArray();
- cache.Add(colorKey, svg);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 删除或关闭图片(一个叉叉)
- /// </summary>
- /// <param name="colorStr"></param>
- /// <param name="opacity"></param>
- /// <returns></returns>
- public static SvgImage CreateClose(string colorStr = "#D11C1C", double opacity = 1)
- {
- if (string.IsNullOrWhiteSpace(colorStr))
- colorStr = $"#D11C1C";
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>\r\n<g>\r\n<path opacity=\"{opacity}\" fill=\"{colorStr}\" d=\"M18.8,16l6.9-6.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L9.1,6.3c-0.4-0.4-1-0.4-1.4,0\r\nL6.3,7.7c-0.4,0.4-0.4,1,0,1.4l6.9,6.9l-6.9,6.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l6.9-6.9l6.9,6.9\r\nc0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z\"/>\r\n</g>\r\n</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 清除图片(一个橡皮擦)
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateClear()
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>\r\n<path class=\"Blue\" d=\"M16.1,23.1l-4.4,4.4c-0.7,0.7-1.9,0.7-2.6,0l-6.6-6.6c-0.7-0.7-0.7-1.9,0-2.6L6.9,14L16.1,23.1z\"/><path class=\"Red\" d=\"M27.5,11.8l-10,10l-9.2-9.2l10-10c0.7-0.7,1.9-0.7,2.6,0l6.6,6.6C28.2,9.9,28.2,11,27.5,11.8z\"/></svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 测距图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateDistanceLine()
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>"
- + "<path class=\"Blue\" d=\"M27,8c-1.7,0-3,1.3-3,3c0,0.5,0.1,0.9,0.3,1.3l-6,6C17.9,18.1,17.5,18,17,18s-0.9,0.1-1.3,0.3l-2-2\r\n\t\tc0.2-0.4,0.3-0.8,0.3-1.3c0-1.7-1.3-3-3-3s-3,1.3-3,3c0,0.5,0.1,0.9,0.3,1.3l-2,2C5.9,18.1,5.5,18,5,18c-1.7,0-3,1.3-3,3s1.3,3,3,3\r\n\t\ts3-1.3,3-3c0-0.5-0.1-0.9-0.3-1.3l2-2c0.4,0.2,0.8,0.3,1.3,0.3s0.9-0.1,1.3-0.3l2,2C14.1,20.1,14,20.5,14,21c0,1.7,1.3,3,3,3\r\n\t\ts3-1.3,3-3c0-0.5-0.1-0.9-0.3-1.3l6-6c0.4,0.2,0.8,0.3,1.3,0.3c1.7,0,3-1.3,3-3S28.7,8,27,8z M5,22c-0.6,0-1-0.4-1-1s0.4-1,1-1\r\n\t\ts1,0.4,1,1S5.6,22,5,22z M11,16c-0.6,0-1-0.4-1-1s0.4-1,1-1s1,0.4,1,1S11.6,16,11,16z M17,22c-0.6,0-1-0.4-1-1s0.4-1,1-1s1,0.4,1,1\r\n\t\tS17.6,22,17,22z M27,12c-0.6,0-1-0.4-1-1s0.4-1,1-1s1,0.4,1,1S27.6,12,27,12z\"/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 标点图片(一个五角星)
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateMarkDot(string color = "#F12233", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d=\"M6,8c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2s0.9-2,2-2C5.1,6,6,6.9,6,8z M10,22c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S11.1,22,10,22z M18,16c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S19.1,16,18,16z M22,8c-1.1,0-2,0.9-2,2c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C24,8.9,23.1,8,22,8z M28,4c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S29.1,4,28,4z\"/><path class=\"Yellow\" d=\"M8,18c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2s0.9-2,2-2C7.1,16,8,16.9,8,18z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S13.1,10,12,10z M4,26c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S5.1,26,4,26z M20,2c-1.1,0-2,0.9-2,2s0.9,2,2,2\r\n\tc1.1,0,2-0.9,2-2S21.1,2,20,2z M28,12c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S29.1,12,28,12z\"/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 参考站发射天线
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateAntRef(string color = "#3F23A7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 493.68 493.68'>"
- + $"<path fill='{color}' d='M181.635,114.208c-18.21,0-32.97,14.761-32.97,32.97c0,18.204,14.76,32.969,32.97,32.969 c43.933,0,79.687,35.721,79.687,79.623c0,18.205,14.761,32.971,32.971,32.971c18.204,0,32.971-14.766,32.971-32.971 C327.263,179.499,261.93,114.208,181.635,114.208z'/>"
- +$"<path fill='{color}' d='M158.372,0c-0.018,0-0.051,0-0.063,0c-18.228,0-32.97,14.768-32.97,32.971c0,18.209,14.762,32.969,32.97,32.969 c0.028,0,0.028,0,0.063,0c119.69,0,217.105,97.418,217.152,217.158c0,18.203,14.76,32.953,32.97,32.953h0.018 c18.204,0,32.953-14.777,32.953-32.988C441.419,126.971,314.429,0,158.372,0z'/>"
- +$"<path fill='{color}' d='M212.673,324.836c21.652-26.961,20.298-66.321-4.719-91.338c-26.834-26.852-70.35-26.852-97.173,0c-24.646,24.645-26.384,63.219-5.729,90.137L53.455,466.059c-3.878,10.703,1.644,22.522,12.345,26.383c2.323,0.85,4.689,1.238,7.023,1.238c8.42,0,16.34-5.197,19.367-13.584l47.973-132.395c12.137,3.525,24.906,3.65,37.092,0.369l47.844,132.025c3.027,8.387,10.946,13.584,19.368,13.584c2.333,0,4.7-0.389,7.015-1.238c10.708-3.861,16.23-15.68,12.353-26.383 L212.673,324.836z'/>\r\n"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 卫星接收天线
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateAntRec(string color = "#3F23A7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 32 32'>" + $"<path fill='{color}' opacity='0.7' d='M14.313 1.003l0 0 0-0zM30.467 8.066c-0.54-0.935-1.735-1.255-2.671-0.715-0.705 0.407-1.060 1.187-0.962 1.947l-6.583 2-5.938-10.294c-3.469 3.284-5.122 8.047-4.481 12.693l-2.235 0.393 0.666 3.779-2.624 2.456 1.166 2.004 3.661-1.11 0.469 0.617-7.11 8.881h15.83l-1.046-5.642c3.083 1.285 6.584 1.506 9.889 0.52l-5.938-10.294 5.020-4.704c0.609 0.468 1.463 0.551 2.17 0.143 0.935-0.541 1.256-1.737 0.717-2.672z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 雷达测向天线
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateAntRadar(string color = "#3F23A7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 502.614 502.614'>"
- + $"<circle fill='#80D6FA' cx='250.733' cy='249.454' r='247.467'/>"
- + $"<path fill='#ECF4F7' d='M394.093,141.934c-4.267,3.413-9.387,5.12-15.36,5.12c-14.507,0-25.6-11.093-25.6-25.6c0-5.973,1.707-11.093,5.12-15.36c4.267-5.973,11.947-10.24,20.48-10.24c14.507,0,25.6,11.093,25.6,25.6C404.333,129.987,400.067,136.813,394.093,141.934zM406.893,441.454c-6.827-4.267-11.093-12.8-11.093-21.333c0-14.507,11.093-25.6,25.6-25.6s25.6,11.093,25.6,25.6s-11.093,25.6-25.6,25.6C416.28,445.72,411.16,444.013,406.893,441.454zM250.733,334.787c14.507,0,25.6,11.093,25.6,25.6s-11.093,25.6-25.6,25.6c-14.507,0-25.6-11.093-25.6-25.6 S236.227,334.787,250.733,334.787z'/>"
- + $"<path fill='#51565F' d='M251.733,502.187C112.64,502.187,0,389.547,0,250.454c0-47.787,13.653-93.867,38.4-133.973 c0.853-1.707,4.267-2.56,5.973-1.707c1.707,0.853,2.56,4.267,1.707,5.973c-24.747,38.4-37.547,83.627-37.547,129.707 c0,133.973,109.227,243.2,243.2,243.2c53.76,0,106.667-17.92,149.333-51.2c-5.12-5.12-8.533-12.8-8.533-21.333 c0-16.213,13.653-29.867,29.867-29.867c8.533,0,15.36,3.413,21.333,8.533c33.28-42.667,51.2-95.573,51.2-149.333 c0-133.973-109.227-243.2-243.2-243.2c-65.707,0-121.173,22.187-168.96,68.267l41.813,41.813 c34.133-32.427,79.36-50.347,126.293-50.347c38.4,0,75.947,11.947,106.667,34.133c5.12-5.12,12.8-8.533,21.333-8.533 c16.213,0,29.867,13.653,29.867,29.867c0,8.533-3.413,15.36-8.533,21.333c22.187,31.573,34.133,68.267,34.133,106.667 c0,101.547-81.92,183.467-183.467,183.467c-101.547,0-183.467-81.92-183.467-183.467c0-35.84,10.24-70.827,29.867-100.693 c1.707-1.707,4.267-2.56,5.973-0.853c1.707,1.707,2.56,4.267,0.853,5.973c-18.773,29.013-29.013,61.44-29.013,96.427 c0,96.427,78.507,174.933,174.933,174.933S424.96,347.734,424.96,251.307c0-36.693-11.093-71.68-32.427-101.547 c-4.267,2.56-9.387,3.413-14.507,3.413c-16.213,0-29.867-13.653-29.867-29.867c0-5.12,1.707-10.24,3.413-14.507 c-29.867-21.333-64.853-32.427-101.547-32.427c-45.227,0-87.893,17.067-120.32,48.64l42.667,42.667 c21.333-19.627,48.64-30.72,78.507-30.72c63.147,0,115.2,52.053,115.2,115.2c0,52.053-34.987,98.133-85.333,110.933 c0,16.213-13.653,29.867-29.867,29.867s-29.867-12.8-29.867-29.867c-50.347-13.653-85.333-58.88-85.333-110.933 c0-17.067,4.267-34.133,11.947-50.347c0.853-1.707,3.413-3.413,5.973-1.707c1.707,0.853,3.413,3.413,1.707,5.973 c-6.827,14.507-11.093,30.72-11.093,46.933c0,48.64,31.573,89.6,77.653,102.4c3.413-12.8,15.36-21.333,29.013-21.333 c13.653,0,24.747,9.387,29.013,21.333c46.08-12.8,77.653-54.613,77.653-102.4c0-58.88-47.787-106.667-106.667-106.667 c-27.307,0-52.907,10.24-72.533,28.16l41.813,41.813c7.68-6.827,17.92-10.24,30.72-10.24c25.6,0,46.933,21.333,46.933,46.933 s-21.333,46.933-46.933,46.933s-46.933-21.333-46.933-46.933c0-2.56,1.707-4.267,4.267-4.267c2.56,0,4.267,1.707,4.267,4.267 c0,21.333,17.067,38.4,38.4,38.4s38.4-17.067,38.4-38.4s-17.067-38.4-38.4-38.4c-9.387,0-17.92,2.56-23.893,7.68l27.307,27.307 c1.707,1.707,1.707,4.267,0,5.973c-1.707,1.707-4.267,1.707-5.973,0l-30.72-30.72l0,0l-96.427-96.427l0,0l0,0L73.387,80.64 c-1.707-1.707-1.707-4.267,0-5.973c49.493-49.493,107.52-74.24,177.493-74.24c139.093,0,251.733,112.64,251.733,251.733 c0,57.173-19.627,112.64-54.613,157.013c2.56,4.267,3.413,8.533,3.413,13.653c0,16.213-13.653,29.867-29.867,29.867 c-5.12,0-10.24-0.853-13.653-3.413C364.373,482.56,308.907,502.187,251.733,502.187z M412.16,439.894 c2.56,1.707,5.973,2.56,10.24,2.56c11.947,0,21.333-9.387,21.333-21.333s-9.387-21.333-21.333-21.333s-21.333,9.387-21.333,21.333 c0,6.827,3.413,12.8,7.68,16.213c0.853,0,2.56,0.853,3.413,1.707C412.16,439.04,412.16,439.894,412.16,439.894z M251.733,340.054 c-11.947,0-21.333,9.387-21.333,21.333s9.387,21.333,21.333,21.333c11.947,0,21.333-9.387,21.333-21.333 S263.68,340.054,251.733,340.054z M362.667,110.507c-2.56,3.413-4.267,7.68-4.267,11.947c0,11.947,9.387,21.333,21.333,21.333 c4.267,0,7.68-0.853,11.093-3.413c0-0.853,0.853-0.853,1.707-1.707c0.853-0.853,1.707-0.853,1.707-0.853 c4.267-4.267,6.827-9.387,6.827-15.36c0-11.947-9.387-21.333-21.333-21.333c-6.827,0-12.8,3.413-17.067,7.68C362.667,109.654,362.667,109.654,362.667,110.507C362.667,109.654,362.667,109.654,362.667,110.507z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 样本文件图标
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateSampleFile(string color = "#3F23A7", int width = 24, int height = 24)
- {
- string xml = $"<svg fill='{color}' xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- +$"<path d='M4.637,24.096c-0.384,0-0.708-0.072-0.972-0.216s-0.492-0.338-0.684-0.584l0.504-0.432 c0.155,0.198,0.33,0.35,0.524,0.456c0.195,0.107,0.42,0.16,0.676,0.16c0.267,0,0.469-0.055,0.608-0.164S5.5,23.056,5.5,22.863 c0-0.154-0.047-0.282-0.14-0.384c-0.093-0.101-0.268-0.17-0.524-0.208l-0.352-0.056c-0.197-0.026-0.378-0.069-0.544-0.128 c-0.166-0.059-0.307-0.136-0.424-0.232c-0.118-0.096-0.209-0.213-0.276-0.352s-0.1-0.304-0.1-0.496c0-0.203,0.037-0.382,0.112-0.54 c0.075-0.157,0.179-0.288,0.312-0.392s0.292-0.183,0.476-0.236c0.184-0.053,0.385-0.08,0.604-0.08c0.352,0,0.645,0.059,0.88,0.176 s0.44,0.28,0.616,0.488l-0.472,0.448c-0.102-0.133-0.239-0.25-0.412-0.348s-0.385-0.148-0.636-0.148 c-0.256,0-0.447,0.053-0.572,0.16c-0.125,0.106-0.188,0.248-0.188,0.424c0,0.187,0.06,0.323,0.18,0.408 c0.12,0.085,0.3,0.146,0.54,0.184l0.352,0.056c0.458,0.069,0.788,0.203,0.988,0.4c0.2,0.198,0.3,0.456,0.3,0.776 c0,0.405-0.142,0.725-0.424,0.96C5.514,23.978,5.127,24.096,4.637,24.096z M10.3,24c-0.229,0-0.401-0.064-0.516-0.192 s-0.185-0.293-0.212-0.496h-0.04c-0.085,0.256-0.232,0.451-0.44,0.584s-0.461,0.2-0.76,0.2c-0.432,0-0.768-0.111-1.008-0.332 s-0.36-0.524-0.36-0.908c0-0.4,0.146-0.705,0.436-0.916c0.291-0.21,0.735-0.316,1.332-0.316h0.784v-0.376 c0-0.277-0.075-0.491-0.224-0.64s-0.381-0.224-0.696-0.224c-0.245,0-0.449,0.055-0.612,0.164C7.821,20.657,7.687,20.8,7.58,20.976 l-0.448-0.408c0.123-0.224,0.308-0.415,0.556-0.572s0.564-0.236,0.948-0.236c0.518,0,0.917,0.124,1.2,0.372s0.424,0.597,0.424,1.049 v2.179h0.464V24H10.3z M8.5,23.496c0.293,0,0.536-0.067,0.728-0.2s0.288-0.304,0.288-0.512v-0.64H8.725 c-0.342,0-0.591,0.051-0.748,0.152c-0.158,0.102-0.236,0.248-0.236,0.44v0.16c0,0.192,0.068,0.34,0.204,0.444 C8.081,23.443,8.266,23.496,8.5,23.496z M11.612,24v-4.144h0.744v0.672h0.04c0.091-0.211,0.228-0.392,0.412-0.542 s0.415-0.226,0.692-0.226s0.529,0.066,0.756,0.198c0.227,0.132,0.394,0.344,0.5,0.634h0.016c0.075-0.222,0.217-0.416,0.428-0.583 c0.21-0.167,0.489-0.25,0.836-0.25c0.416,0,0.741,0.139,0.976,0.416c0.234,0.278,0.352,0.669,0.352,1.176V24H16.62v-2.542 c0-0.353-0.068-0.618-0.204-0.794s-0.348-0.265-0.636-0.265c-0.123,0-0.239,0.016-0.348,0.048s-0.207,0.079-0.292,0.14 c-0.085,0.062-0.153,0.139-0.204,0.232c-0.051,0.094-0.076,0.205-0.076,0.333V24h-0.744v-2.542c0-0.706-0.277-1.059-0.832-1.059 c-0.118,0-0.232,0.016-0.344,0.048c-0.112,0.032-0.21,0.079-0.296,0.14s-0.155,0.139-0.208,0.232 c-0.053,0.094-0.08,0.205-0.08,0.333V24H11.612z M18.628,19.855h0.744v0.672h0.032c0.096-0.253,0.247-0.445,0.452-0.574 c0.206-0.129,0.452-0.194,0.74-0.194c0.261,0,0.495,0.05,0.7,0.148c0.205,0.099,0.38,0.243,0.524,0.432 c0.144,0.189,0.253,0.417,0.328,0.684s0.112,0.568,0.112,0.904c0,0.336-0.038,0.637-0.112,0.904s-0.184,0.495-0.328,0.684 s-0.319,0.333-0.524,0.432c-0.206,0.098-0.439,0.148-0.7,0.148c-0.288,0-0.535-0.065-0.74-0.194s-0.356-0.321-0.452-0.574h-0.032 V25.6h-0.744V19.855z M20.38,23.456c0.336,0,0.601-0.107,0.796-0.322c0.194-0.214,0.292-0.499,0.292-0.853v-0.708 c0-0.354-0.098-0.638-0.292-0.853c-0.195-0.214-0.46-0.322-0.796-0.322c-0.139,0-0.27,0.019-0.392,0.057 c-0.123,0.037-0.229,0.091-0.32,0.161c-0.09,0.07-0.163,0.15-0.216,0.241s-0.08,0.193-0.08,0.306v1.528 c0,0.113,0.027,0.215,0.08,0.306s0.125,0.172,0.216,0.241c0.091,0.07,0.197,0.124,0.32,0.161 C20.111,23.437,20.241,23.456,20.38,23.456z M24.084,24c-0.256,0-0.45-0.069-0.58-0.208c-0.131-0.139-0.196-0.323-0.196-0.552v-5.16 h0.744v5.28h0.592V24H24.084z M27.117,24.096c-0.288,0-0.548-0.052-0.78-0.156s-0.429-0.249-0.592-0.436s-0.288-0.413-0.376-0.68 s-0.132-0.565-0.132-0.896c0-0.326,0.044-0.623,0.132-0.892c0.088-0.27,0.213-0.498,0.376-0.684c0.163-0.187,0.36-0.332,0.592-0.436 s0.492-0.156,0.78-0.156s0.545,0.052,0.772,0.156s0.417,0.246,0.572,0.427s0.272,0.396,0.352,0.646s0.12,0.518,0.12,0.805v0.311 h-2.92v0.168c0,0.347,0.101,0.631,0.304,0.852s0.491,0.332,0.864,0.332c0.261,0,0.485-0.059,0.672-0.176s0.336-0.282,0.448-0.496 l0.48,0.41c-0.144,0.274-0.36,0.493-0.648,0.656S27.506,24.096,27.117,24.096z M27.117,20.359c-0.16,0-0.308,0.029-0.444,0.087 c-0.136,0.059-0.253,0.139-0.352,0.243s-0.175,0.227-0.228,0.37s-0.08,0.299-0.08,0.469v0.056h2.128v-0.08 c0-0.344-0.092-0.621-0.276-0.831C27.681,20.464,27.431,20.359,27.117,20.359z M31,15.64h-2.64V7c0-0.096-0.038-0.187-0.105-0.254 l-6-6C22.188,0.678,22.096,0.64,22,0.64H4C3.801,0.64,3.64,0.801,3.64,1v14.64H1c-0.199,0-0.36,0.161-0.36,0.36v11 c0,0.199,0.161,0.36,0.36,0.36h2.64V31c0,0.199,0.161,0.36,0.36,0.36h24c0.199,0,0.36-0.161,0.36-0.36v-3.64H31 c0.199,0,0.36-0.161,0.36-0.36V16C31.36,15.801,31.199,15.64,31,15.64z M22.36,1.87l4.771,4.771H22.36V1.87z M4.36,1.36h17.28V7 c0,0.199,0.161,0.36,0.36,0.36h5.64v8.28H4.36V1.36z M27.64,30.64H4.36v-3.28h23.28C27.64,27.36,27.64,30.64,27.64,30.64z M30.64,26.64H1.36V16.36h29.28C30.64,16.36,30.64,26.64,30.64,26.64z'/>"
- +$"<rect fill='none' width='32' height='32'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 圆点
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateGeoDot(string color = "#D11C1C", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 32 32'>" + $"<path fill='{color}' d='M16,2C10.5,2,6,6.5,6,12s10,18,10,18s10-12.5,10-18S21.5,2,16,2z M16,16c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S18.2,16,16,16z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 五角星图片
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreatePentagram(string color = "#1177D7", double opacity=0.3,int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>" + $"<polygon fill='{color}' opacity='{opacity}' points='16,4 19.9,11.9 28.6,13.2 22.3,19.3 23.8,28 16,23.9 8.2,28 9.7,19.3 3.4,13.2 12.1,11.9'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 卫星图片
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateSat(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 297.131 297.131'>"
- + $"<path fill='{color}' d='M196.826,68.171c17.691,0.002,32.084,14.405,32.084,32.108c0,5.54,4.492,10.033,10.033,10.033 c5.54,0,10.033-4.493,10.033-10.033c0-28.768-23.394-52.173-52.148-52.175h-0.001c-5.54,0-10.033,4.491-10.033,10.032 C186.794,63.679,191.286,68.171,196.826,68.171z'/>"
- + $"<path fill='{color}' d='M196.827,34.094c36.476,0.002,66.15,29.692,66.15,66.186c0,5.54,4.492,10.033,10.033,10.033 c5.541,0,10.033-4.493,10.033-10.033c0-47.558-38.677-86.25-86.217-86.252c-5.54,0-10.033,4.491-10.033,10.033 C186.794,29.601,191.286,34.094,196.827,34.094z'/>"
- + $"<path fill='{color}' d='M187.387,160.099c13.264-13.271,13.264-34.984,0-48.254l-2.119-2.12c-6.631-6.635-15.374-9.952-24.115-9.952 c-8.743,0-17.484,3.316-24.116,9.953l-27.294,27.307c-13.264,13.271-13.264,34.984,0,48.254l2.12,2.12 c6.631,6.635,15.374,9.952,24.114,9.952c8.744,0,17.485-3.316,24.117-9.953L187.387,160.099z'/> "
- + $"<path fill='{color}' d='M98.388,125.684l27.295-27.307c7.865-7.869,17.917-12.782,28.811-14.212l-8.862-26.783 c-0.492-1.485-1.323-2.834-2.43-3.94L92.722,2.94C90.841,1.058,88.287,0,85.626,0c-2.662,0-5.215,1.059-7.097,2.94L3.001,78.505 c-3.915,3.918-3.915,10.269,0.002,14.186l50.48,50.501c1.106,1.107,2.456,1.938,3.941,2.432l26.752,8.861 C85.579,143.943,90.31,133.767,98.388,125.684z'/>"
- + $"<path fill='{color}' d='M294.128,204.439l-50.481-50.499c-1.107-1.106-2.456-1.938-3.941-2.43l-26.753-8.864 c-1.403,10.541-6.134,20.718-14.212,28.8l-27.294,27.308c-7.865,7.869-17.916,12.782-28.809,14.212l8.862,26.781 c0.492,1.484,1.323,2.834,2.429,3.941l50.478,50.503c1.882,1.882,4.435,2.94,7.097,2.94s5.215-1.058,7.096-2.94l75.529-75.564 C298.045,214.708,298.045,208.357,294.128,204.439z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateRect(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 512 512'>"
- + $"<path fill='{color}' d='M0,0v512h512V0H0z M465.5,465.5H46.5V46.5h418.9V465.5z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 时隙参估图片
- /// </summary>
- /// <param name="color"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <returns></returns>
- public static SvgImage CreateSlotCg(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M6,30H2V2h4V30z M12,2H8v28h4V2z M18,2h-4v28h4V2z M24,2h-4v28h4V2z M30,2h-4v28h4V2z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 导出图像图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateExportImg()
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<style type=\"text/css\">\r\n\t.Black{fill:#727272;}\r\n\t.Blue{fill:#1177D7;}\r\n\t.Red{fill:#D11C1C;}\r\n\t.st0{opacity:0.2;}\r\n</style>\r\n<path class=\"Black\" d=\"M8,4h18v6h2V3c0-0.5-0.5-1-1-1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.8,0.1,1.4,0.1,2v4.3h-1.4v-7.7h2.2l1.4,4.6c0.1,0.4,0.2,0.7,0.2,1.1l0,0c0.1-0.4,0.2-0.8,0.3-1.1l1.4-4.6H19v7.7H18.9z M26,17.3c-0.7,0.4-1.5,0.7-2.5,0.7c-1.1,0-2-0.3-2.6-1S20,15.4,20,14.2s0.3-2.2,1-3s1.6-1.1,2.8-1.1c0.7,0,1.4,0.1,1.9,0.3V12\r\n\t\tc-0.5-0.3-1.2-0.5-1.9-0.5c-0.6,0-1.2,0.2-1.6,0.7s-0.6,1.1-0.6,1.9c0,0.8,0.2,1.4,0.5,1.8c0.4,0.4,0.8,0.6,1.5,0.6\r\n\t\tc0.4,0,0.7-0.1,0.9-0.2v-1.5h-1.4v-1.4H26V17.3z\"/>\r\n</g>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateImport(int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='#727272' d='M12,12H8V6h4V12z M24,17v1v9c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h3v8h14L24,17z M20,18H6v6h14V18z'/>"
- + "<polygon fill='#039C23' points='32,6 24,6 24,2 16,8 24,14 24,10 32,10'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 导出Excel图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateExportXlsx()
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<style type=\"text/css\">\r\n\t.Green{fill:#039C23;}\r\n\t.Black{fill:#727272;}\r\n\t.Blue{fill:#1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
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 导出Csv图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateExportCsv()
- {
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<style type=\"text/css\">.Black{fill:#727272;}.Blue{fill:#1177D7;}</style><path class=\"Black\" d=\"M8,4h18v6h2V3c0-0.5-0.5-1-1-1H7C6.5,2,6,2.5,6,3v7h2V4z\"/>\r\n<path class=\"Black\" d=\"M26,28H8V18H6v11c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V18h-2V28z\"/>\r\n<path class=\"Blue\" d=\"M29,8h-1h-2H8H6H5C4.4,8,4,8.4,4,9v10c0,0.6,0.4,1,1,1h1h2h18h2h1c0.6,0,1-0.4,1-1V9C30,8.4,29.6,8,29,8z\r\n\t M12.9,12c-0.5-0.3-1-0.5-1.6-0.5c-0.7,0-1.2,0.2-1.6,0.7C9.2,12.6,9,13.3,9,14c0,0.7,0.2,1.3,0.6,1.8s0.9,0.7,1.6,0.7\r\n\tc0.6,0,1.2-0.2,1.7-0.5v1.6c-0.5,0.3-1.2,0.4-2,0.4c-1.1,0-2-0.3-2.6-1c-0.1-0.1-0.2-0.2-0.2-0.3c-0.5-0.6-0.7-1.5-0.7-2.4\r\n\tc0-1,0.2-1.8,0.7-2.5c0.1-0.2,0.2-0.3,0.4-0.5C9.1,10.4,10,10,11.1,10c0.7,0,1.3,0.1,1.8,0.3V12z M19.2,16.8\r\n\tc-0.2,0.3-0.4,0.5-0.6,0.7c-0.3,0.2-0.6,0.3-0.9,0.4C17.4,17.9,17,18,16.6,18c-0.4,0-0.8,0-1.1-0.1c-0.4-0.1-0.7-0.2-0.9-0.3v-1.7\r\n\tc0.3,0.3,0.6,0.5,0.9,0.6c0.3,0.1,0.7,0.2,1,0.2c0.2,0,0.4,0,0.5-0.1c0.2,0,0.3-0.1,0.4-0.2c0.1-0.1,0.2-0.2,0.2-0.2\r\n\tc0.1-0.1,0.1-0.2,0.1-0.3c0-0.2,0-0.3-0.1-0.4s-0.2-0.2-0.3-0.3s-0.3-0.2-0.5-0.3s-0.4-0.2-0.6-0.3c-0.6-0.3-1-0.6-1.2-0.9\r\n\ts-0.4-0.8-0.4-1.3c0-0.4,0.1-0.7,0.2-1c0.1-0.3,0.4-0.5,0.6-0.7s0.6-0.3,0.9-0.4c0.3-0.1,0.7-0.1,1.1-0.1c0.4,0,0.7,0,1,0.1\r\n\tc0.3,0,0.6,0.1,0.8,0.2v1.6c-0.1-0.1-0.3-0.2-0.4-0.2c-0.1-0.1-0.3-0.1-0.4-0.2c-0.1,0-0.3-0.1-0.4-0.1c-0.1,0-0.3,0-0.4,0\r\n\tc-0.2,0-0.3,0-0.5,0.1c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.1-0.2,0.2c-0.1,0.1-0.1,0.2-0.1,0.3c0,0.1,0,0.2,0.1,0.3\r\n\tc0.1,0.1,0.2,0.2,0.3,0.3c0.1,0.1,0.3,0.2,0.4,0.3c0.2,0.1,0.4,0.2,0.6,0.3c0.3,0.1,0.5,0.3,0.8,0.4c0.2,0.1,0.4,0.3,0.6,0.5\r\n\tc0.2,0.2,0.3,0.4,0.4,0.6c0.1,0.2,0.1,0.5,0.1,0.8C19.5,16.1,19.4,16.5,19.2,16.8z M26,13.2l-1.5,4.7h-1.8L20.3,10H22l1.5,5.5\r\n\tc0.1,0.3,0.1,0.5,0.1,0.8h0c0-0.2,0.1-0.5,0.2-0.8l1.5-5.5H26h1L26,13.2z\"/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 时差线图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateDtoLine(string color = "#039C23", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M32,16c0,4.4-3.6,8-8,8c-0.2,0-0.3,0-0.5,0c1.6-2.3,2.5-5.1,2.5-8s-0.9-5.6-2.5-8c0.2,0,0.3,0,0.5,0C28.4,8,32,11.6,32,16z M14,16c0-3.9,2.3-7.5,5.8-9.1C17.7,5.1,15,4,12,4C5.4,4,0,9.4,0,16c0,6.6,5.4,12,12,12c3,0,5.7-1.1,7.8-2.9C16.3,23.5,14,19.9,14,16z M21.3,8.5C18.2,9.6,16,12.5,16,16s2.2,6.4,5.3,7.5C23,21.5,24,18.9,24,16S23,10.5,21.3,8.5z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 频差线图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateDfoLine(string color = "#039C23", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path opacity='0.75' fill='{color}' d='M20.6,8.6C17.8,10.8,16,14.2,16,18c0,0.6-0.1,1.1-0.4,1.6C15,21,13.6,22,12,22c-2.2,0-4-1.8-4-4c0-3.3-2.7-6-6-6v2v2c1.1,0,2,0.9,2,2c0,4.4,3.6,8,8,8c0.7,0,1.4-0.1,2-0.3c0,0,0.1,0,0.1,0c0.2-0.1,0.5-0.1,0.7-0.2c0.1,0,0.1,0,0.2-0.1c0.3-0.1,0.5-0.2,0.8-0.4c0.1-0.1,0.3-0.2,0.4-0.2c0.1-0.1,0.2-0.1,0.3-0.2c0.2-0.1,0.3-0.2,0.4-0.3c0.1-0.1,0.2-0.2,0.3-0.2c1.7-1.5,2.7-3.6,2.7-6c0-2.7,1.4-5.1,3.4-6.6c1.3-0.9,2.9-1.4,4.6-1.4V8.3V6C25.2,6,22.6,7,20.6,8.6z'/>"
- + $"<path fill='{color}' d='M14,20c0.6,0,1.1-0.1,1.6-0.4C15,21,13.6,22,12,22c-2.2,0-4-1.8-4-4c0-3.3-2.7-6-6-6l2-2c3.3,0,6,2.7,6,6C10,18.2,11.8,20,14,20z M20,18c0,2.4-1.1,4.5-2.7,6c0.1-0.1,0.3-0.2,0.4-0.3l2-2c1.4-1.4,2.3-3.4,2.3-5.7c0-1.7,0.5-3.3,1.4-4.6C21.4,12.9,20,15.3,20,18z M28,6v2.3V10l2-2V4L28,6z'/>"
- + $"<path opacity='0.5' fill='{color}' d='M20.6,8.6C22.6,7,25.2,6,28,6l2-2C26.2,4,22.8,5.8,20.6,8.6z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 测向线图片
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateCxLine(string color1 = "#FFB115", string color2 = "#039C23", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<rect x='8.9' y='15' fill='{color1}' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -6.6274 16)' width='14.1' height='2'/>"
- + $"<path fill='{color2}' d='M10,26H4v-4h6V26z M28,6h-6v4h6V6z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// GDOP
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateGDOP(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path opacity='0.35' fill='#727272' d='M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M16,30C8.3,30,2,23.7,2,16S8.3,2,16,2\ts14,6.3,14,14S23.7,30,16,30z M16,6C10.5,6,6,10.5,6,16c0,5.5,4.5,10,10,10s10-4.5,10-10C26,10.5,21.5,6,16,6z M16,24c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8S20.4,24,16,24z M16,12c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4s4-1.8,4-4C20,13.8,18.2,12,16,12zM16,18c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2s2,0.9,2,2C18,17.1,17.1,18,16,18z'/>"
- + $"<path fill='{color}' d='M15,4c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1c6.1,0,11,4.9,11,11c0,4.4-3.6,8-8,8s-8-3.6-8-8c0-2.8,2.2-5,5-5s5,2.2,5,5c0,1.7-1.3,3-3,3s-3-1.3-3-3c0-0.6,0.4-1,1-1s1,0.4,1,1c0,0.6,0.4,1,1,1s1-0.4,1-1c0-1.7-1.3-3-3-3s-3,1.3-3,3c0,2.8,2.2,5,5,5s5-2.2,5-5c0-3.9-3.1-7-7-7s-7,3.1-7,7c0,5.5,4.5,10,10,10s10-4.5,10-10C28,9.8,22.2,4,15,4z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 查看参估结果
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateShowCafRes(string color = "#387CB7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M27,2H1C0.5,2,0,2.5,0,3v7h28V3C28,2.5,27.5,2,27,2z'/>"
- + $"<path opacity='0.5' fill='#737374' d='M26,16.2V10h2v6.9C27.4,16.6,26.7,16.4,26,16.2z M14.1,24.7L13.9,24H2V10H0v15c0,0.5,0.5,1,1,1h13.8C14.4,25.3,14.2,24.8,14.1,24.7z'/>"
- + $"<path fill='#737374' d='M24,18c-5.7,0-8,6-8,6s2.3,6,8,6s8-6,8-6S29.7,18,24,18z M24,28c-2.2,0-4-1.8-4-4c0-2.2,1.8-4,4-4c2.2,0,4,1.8,4,4C28,26.2,26.2,28,24,28z M26,24c0,1.1-0.9,2-2,2s-2-0.9-2-2s0.9-2,2-2S26,22.9,26,24z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 查看测向结果
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateShowCxRes(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<polygon fill='{color}' points='25.4,9.4 30,14 30,2 18,2 22.6,6.6 16,13.2 9.4,6.6 14,2 2,2 2,14 6.6,9.4 13.2,16 6.6,22.6 2,18 2,30 14,30 9.4,25.4 16,18.8 22.6,25.4 18,30 30,30 30,18 25.4,22.6 18.8,16'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 查看检测结果
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateShowCheckRes(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path opacity='0.5' fill='#727272' d='M14,24H2v-8h12V24z M28,16H16v8h12V16z'/>"
- + $"<polygon fill='{color}' points='30,8 28,8 28,4 26,4 26,8 16,8 16,4 14,4 14,8 4,8 4,4 2,4 2,8 0,8 0,10 2,10 2,14 4,14 4,10 14,10 14,14 16,14 16,10 26,10 26,14 28,14 28,10 30,10'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 手动定位
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreatePosManual(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M29,14h-3.1c-0.2-2.3-1.1-4.4-2.5-6l2.2-2.2c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L22,6.5c-1.7-1.4-3.8-2.3-6-2.5\r\nV1c0-0.5-0.4-1-1-1s-1,0.5-1,1v3.1c-2.3,0.2-4.4,1.1-6,2.5L5.8,4.4C5.4,4,4.8,4,4.4,4.4s-0.4,1,0,1.4L6.5,8c-1.4,1.7-2.3,3.8-2.5,6\r\nH1c-0.6,0-1,0.5-1,1s0.4,1,1,1h3.1c0.2,2.3,1.1,4.4,2.5,6l-2.2,2.2c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0L8,23.5c1.7,1.4,3.8,2.3,6,2.5\r\nV29c0,0.5,0.4,1,1,1s1-0.5,1-1v-3.1c2.3-0.2,4.4-1.1,6-2.5l2.2,2.2c0.4,0.4,1,0.4,1.4,0s0.4-1,0-1.4L23.5,22c1.4-1.7,2.3-3.8,2.5-6\r\nH29c0.6,0,1-0.5,1-1S29.6,14,29,14z M16,6.1c1.7,0.2,3.3,0.9,4.6,1.9l-2.9,2.9c-0.5-0.3-1.1-0.6-1.8-0.7V6.1z M14,6.1v4\r\nc-0.6,0.1-1.2,0.4-1.8,0.7L9.4,8C10.7,6.9,12.3,6.3,14,6.1z M8,9.4l2.9,2.9c-0.3,0.5-0.6,1.1-0.7,1.8h-4C6.3,12.3,6.9,10.7,8,9.4z\r\nM6.1,16h4c0.1,0.6,0.4,1.2,0.7,1.8L8,20.6C6.9,19.3,6.3,17.7,6.1,16z M14,23.9c-1.7-0.2-3.3-0.9-4.6-1.9l2.9-2.9\r\nc0.5,0.3,1.1,0.6,1.8,0.7V23.9z M15,18c-1.7,0-3-1.3-3-3s1.3-3,3-3s3,1.3,3,3S16.7,18,15,18z M16,23.9v-4c0.6-0.1,1.2-0.4,1.8-0.7\r\nl2.9,2.9C19.3,23.1,17.7,23.7,16,23.9z M22,20.6l-2.9-2.9c0.3-0.5,0.6-1.1,0.7-1.8h4C23.7,17.7,23.1,19.3,22,20.6z M19.9,14\r\nc-0.1-0.6-0.4-1.2-0.7-1.8L22,9.4c1,1.3,1.7,2.9,1.9,4.6H19.9z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 重新定位
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateRepos(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M16,30L16,30L16,30C14.5,28.3,6,13.5,6,11C6,5.5,10.5,0,16,0s10,5.5,10,11C26,13.5,17.5,28.3,16,30z'/>"
- + $"<path fill='#FFFFFF' d='M16,4c3.3,0,6,2.7,6,6s-2.7,6-6,6s-6-2.7-6-6S12.7,4,16,4z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 使用镜像点
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateUseMirr(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<polygon fill='#727272' points='4,28 4,2 2,2 2,30 30,30 30,28'/>"
- + $"<path fill='{color}' d='M26,18c0-6.6-5.4-12-12-12V2V0L6,8l8,8v-6c4.4,0,8,3.6,8,8h-6l8,8l8-8H26z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 跳转|转到
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateGoto(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M18,8l10,10L18,28v-8H5c-0.5,0-1-0.5-1-1V4h4v12h10V8z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 信号识别
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateSigProc(int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<circle fill='#039C23' cx='9' cy='9' r='7'/>"
- + $"<path fill='#FFB115' d='M24.5,2.4c0.3-0.6,0.8-0.6,1.1,0l6.3,12.5c0.3,0.6,0.1,1.1-0.5,1.1H18.7c-0.6,0-0.8-0.5-0.5-1.1L24.5,2.4z'/>"
- + $"<path fill='#D11C1C' d='M2.4,25.9c-0.5-0.5-0.5-1.3,0-1.8l5.7-5.7c0.5-0.5,1.3-0.5,1.8,0l5.7,5.7c0.5,0.5,0.5,1.3,0,1.8l-5.7,5.7 c-0.5,0.5-1.3,0.5-1.8,0L2.4,25.9z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- /// <summary>
- /// 目标轨迹
- /// </summary>
- /// <returns></returns>
- public static SvgImage CreateTrack(int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<polygon fill='#039C23' points='4,8 10,2 16,8 12,8 12,14 8,14 8,8'/>"
- + $"<path fill='#FFB115' d='M19.5,4H28v8.5l-2.8-2.8l-4.2,4.2l-2.8-2.8l4.2-4.2L19.5,4z M14,19.5V28H5.5l2.8-2.8l-4.2-4.2l2.8-2.8l4.2,4.2L14,19.5z'/>"
- + $"<polygon fill='#D11C1C' points='18,24 24,30 30,24 26,24 26,18 22,18 22,24'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateInfo(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,6c1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S14.9,6,16,6z M20,24h-8v-2h2v-8h-2v-2h2h4v10h2V24z'/>"
- + $"<path fill='{color}' d='M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,6c1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S14.9,6,16,6z M20,24h-8v-2h2v-8h-2v-2h2h4v10h2V24z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateWarning(string color = "#FFB115", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M14.9,4.7c0.6-1,1.5-1,2.1,0l12.7,21.5c0.6,1,0.1,1.8-1,1.8H3.3c-1.2,0-1.6-0.8-1-1.8L14.9,4.7z'/>"
- + $"<circle fill='#727272' cx='16' cy='22' r='2'/>"
- + $"<rect x='14' y='10' fill='#727272' width='4' height='8'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateError(string color = "#D11C1C", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,24c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S17.1,24,16,24z M18,18h-4V8h4V18z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateRefresh(string color = "#039C23", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M24.5,7.5C22.3,5.3,19.3,4,16,4C10.1,4,5.1,8.3,4.2,14h4.1c0.9-3.4,4-6,7.7-6c2.2,0,4.2,0.9,5.6,2.4L18,14h5.7h4.1H28V4L24.5,7.5z'/>"
- + $"<path fill='{color}' d='M16.2,24c-2.2,0-4.2-0.9-5.6-2.4l3.6-3.6H8.4H4.4H4.2v10l3.5-3.5c2.2,2.2,5.2,3.5,8.5,3.5C22.1,28,27,23.7,28,18h-4.1C23,21.4,19.9,24,16.2,24z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateDownload(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M25.2,9.2L18,16.3V2h-4v14.3L6.8,9.2L4,12l12,12l12-12L25.2,9.2z M28,30H4v-4h24V30z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateTskStateStoped(string color = "#D11C1C", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M16,4C9.4,4,4,9.4,4,16s5.4,12,12,12s12-5.4,12-12S22.6,4,16,4z M16,8c1.5,0,2.9,0.4,4.1,1.1l-11,11C8.4,18.9,8,17.5,8,16C8,11.6,11.6,8,16,8zM16,24c-1.5,0-2.8-0.4-4-1.1L22.9,12c0.7,1.2,1.1,2.5,1.1,4C24,20.4,20.4,24,16,24z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateTskStateWaitToRun(string color = "#1177D7", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<polygon fill='#727272' points='16,16 16,10 14,10 14,18 22,18 22,16 '/>"
- + $"<path fill='{color}' d='M16,2C11.6,2,7.7,4,5.2,7.2L2,4v10h0.2h4H12l-4-4c1.8-2.4,4.7-4,8-4c5.5,0,10,4.5,10,10c0,5.5-4.5,10-10,10c-4.8,0-8.9-3.4-9.8-8h-4c1,6.8,6.8,12,13.8,12c7.7,0,14-6.3,14-14S23.7,2,16,2z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateTskStateRunning(string color = "#039C23", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<path fill='{color}' d='M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M12,22V10l10,6L12,22z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- public static SvgImage CreateTskStateStopping(string color = "#D11C1C", int width = 24, int height = 24)
- {
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
- + $"<polygon fill='#727272' points='16,16 16,8 14,8 14,18 24,18 24,16'/>"
- + $"<path fill='{color}' d='M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,26c-5.5,0-10-4.5-10-10c0-5.5,4.5-10,10-10s10,4.5,10,10C26,21.5,21.5,26,16,26z'/>"
- + "</svg>";
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
- var svg = SvgLoader.LoadFromStream(ms);
- ms.Dispose();
- return svg;
- }
- }
- }
|