|
@@ -1,4 +1,5 @@
|
|
|
-using DevExpress.Utils;
|
|
|
+using DevExpress.Drawing.Internal.Fonts.Interop;
|
|
|
+using DevExpress.Utils;
|
|
|
using DevExpress.Utils.Svg;
|
|
|
using DevExpress.XtraMap.Native;
|
|
|
using System;
|
|
@@ -10,6 +11,7 @@ using System.IO.Ports;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Windows.Media;
|
|
|
using System.Xml;
|
|
|
|
|
|
namespace DxHelper
|
|
@@ -132,16 +134,40 @@ namespace DxHelper
|
|
|
}
|
|
|
public static SvgImage CreateMarkDot()
|
|
|
{
|
|
|
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<path class=\"Blue\" 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,2\r\n\tc1.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,2\r\n\tc0,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\"/>\r\n<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,2\r\n\tc1.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\"/>"
|
|
|
+ string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<path class=\"Blue\" 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;
|
|
|
}
|
|
|
- public static SvgImage CreateGeoDot(string color = "#D11C1C")
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 接收天线
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="color"></param>
|
|
|
+ /// <param name="width"></param>
|
|
|
+ /// <param name="height"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static SvgImage CreateAnt(string color = "#1177D7", int width = 24, int height = 24)
|
|
|
{
|
|
|
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" 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'/>"
|
|
|
+ string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 329.871 329.871'>" + $"<path fill='{color}' d='M104.839,60c-8.284,0-15,6.716-15,15c0,8.284,6.716,15,15,15c74.439,0,135,60.561,135,135c0,8.284,6.716,15,15,15c8.284,0,15-6.716,15-15C269.839,134.018,195.82,60,104.839,60z'/> <path fill='{color}' d='M159.141,191.91l18.878-18.877c5.858-5.857,5.858-15.355,0.001-21.213c-5.858-5.858-15.355-5.858-21.214,0l-18.878,18.877l-76.34-76.34c-5.857-5.857-15.355-5.857-21.213,0c-53.791,53.791-53.791,141.314,0,195.105c26.057,26.059,60.701,40.408,97.553,40.408c36.852,0,71.496-14.35,97.553-40.408c5.857-5.857,5.857-15.355,0-21.213L159.141,191.91z'/>"
|
|
|
+ + "</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);
|
|
@@ -155,39 +181,47 @@ namespace DxHelper
|
|
|
/// <param name="viewBoxHeight"></param>
|
|
|
/// <param name="offsetX"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static SvgImage CreatePentagram(string color = "#1177D7")
|
|
|
+ public static SvgImage CreatePentagram(string color = "#1177D7", int width = 24, int height = 24)
|
|
|
{
|
|
|
- string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' viewBox='0 0 32 32'>" + $"<polygon fill='{color}' 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>";
|
|
|
+ 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='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;
|
|
|
}
|
|
|
|
|
|
- public static SvgImage CreateSat()
|
|
|
- {
|
|
|
- string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 64 64'>" +
|
|
|
- $"<path fill='#d0d0d0' d='M24.4 24.4c3.2-3.2 3.2-8.4 0-11.6L12.8 24.4c3.2 3.2 8.4 3.2 11.6 0'/>" +
|
|
|
- $"<path fill='#94989b' d='M27 27c-4.3 4.3-4.3 4.3-6 2.6c-1.7-1.7-1.7-1.7 2.6-6s4.3-4.3 6-2.6c1.7 1.7 1.7 1.7-2.6 6'/>" +
|
|
|
- $"<path fill='#7f8285' d='M37.2 37.2c-4.3 4.3-4.3 4.3-6 2.6l-6.9-6.9c-1.7-1.7-1.7-1.7 2.6-6s4.3-4.3 6-2.6l6.9 6.9c1.7 1.7 1.7 1.7-2.6 6'/>" +
|
|
|
- $"<path fill='#646669' d='M39.6 39.6c-3.2 3.2-3.2 3.2-4.5 1.9c-1.3-1.3-1.3-1.3 1.9-4.5s3.2-3.2 4.5-1.9c1.3 1.2 1.3 1.2-1.9 4.5'/>" +
|
|
|
- $"<path fill='#94989b' d='M22.2 15l-7.1-1.3c0-.3-.1-.5-.3-.7c-.4-.4-1.2-.4-1.6 0c-.4.4-.4 1.2 0 1.6c.2.2.4.3.6.3l1.4 7.2l.8-.8h-.2l-1.2-6.5c.1-.1.2-.1.3-.2c.1-.1.1-.1.1-.2l6.5 1.2v.2l.7-.8'/>" +
|
|
|
- $"<path fill='#3e4347' d='M25.756 37.336l1.485-1.484l.919.92l-1.485 1.484z'/>" +
|
|
|
- $"<path fill='#3e4347' d='M35.866 27.24l1.485-1.484l.919.919l-1.485 1.485z'/>" +
|
|
|
- $"<path fill='#428bc1' d='M31.1 42.6c.2.2.2.5 0 .7L12.5 61.9c-.2.2-.5.2-.7 0l-9.7-9.7c-.1-.2-.1-.5 0-.7l18.6-18.6c.2-.2.5-.2.7 0l9.7 9.7'/>" +
|
|
|
- $"<path fill='#428bc1' d='M61.9 11.9c.2.2.2.5 0 .7L43.3 31.1c-.2.2-.5.2-.7 0l-9.7-9.7c-.2-.2-.2-.5 0-.7L51.5 2.1c.2-.1.5-.1.6 0l9.8 9.8'/>" +
|
|
|
- $"<path fill='#42ade2' d='M3.3 51.8l.7.7h16.4l5.1-5.1H7.7z'/>" +
|
|
|
- $"<path fill='#42ade2' d='M29.2 42.3H12.8l-2.5 2.6H28l1.9-1.9z'/>" +
|
|
|
- $"<path fill='#42ade2' d='M34.1 21l.7.7h16.4l5.1-5.1H38.5z'/>" +
|
|
|
- $"<path fill='#42ade2' d='M60 11.5H43.6l-2.5 2.6h17.7l1.9-1.9z'/>"
|
|
|
+ /// <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;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
#region exportImg
|
|
|
public static SvgImage CreateExportImg()
|