├── .gitignore ├── ExtendedPaint ├── ExtendedPaint.sln └── ExtendedPaint │ ├── ColorSelector.Designer.cs │ ├── ColorSelector.cs │ ├── ColorSelector.resx │ ├── Core │ ├── CursorsHolder.cs │ ├── EPCanvas.cs │ ├── EPConst.cs │ └── EPKernel.cs │ ├── ExtendedPaint.csproj │ ├── FormAbout.Designer.cs │ ├── FormAbout.cs │ ├── FormAbout.resx │ ├── FormMain.Designer.cs │ ├── FormMain.cs │ ├── FormMain.resx │ ├── Helpers │ ├── DrawHelper.cs │ ├── GeometricHelper.cs │ ├── ScaleHelper.cs │ ├── ShapeHelper.cs │ └── TransformHelper.cs │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── Resources │ ├── anti_false.png │ ├── anti_true.png │ ├── cap_circle_left.png │ ├── cap_circle_right.png │ ├── cap_rect_left.png │ ├── cap_rect_right.png │ ├── cap_round_left.png │ ├── cap_round_right.png │ ├── cap_square_left.png │ ├── cap_square_right.png │ ├── dash-dot.png │ ├── dash.png │ ├── dash2.png │ ├── dash_dot_dot.png │ ├── dot.png │ ├── line_arrow_left.png │ ├── line_arrow_right.png │ ├── normal_arrow_left.png │ ├── normal_arrow_right.png │ ├── pan.cur │ ├── rotate.cur │ ├── select.cur │ ├── select2.cur │ ├── sharp_arrow2_left.png │ ├── sharp_arrow2_right.png │ ├── sharp_arrow_left.png │ ├── sharp_arrow_right.png │ ├── size_0.cur │ ├── size_90.cur │ ├── solid.png │ ├── tool_ellipse.cur │ ├── tool_line.cur │ └── tool_rect.cur │ ├── Shapes │ ├── common │ │ ├── CircleCap.cs │ │ ├── LineArrowCap.cs │ │ ├── RectangleCap.cs │ │ └── SharpArrowCap.cs │ ├── enums │ │ ├── HotSpotType.cs │ │ ├── IndicatorSize.cs │ │ ├── LineCapType.cs │ │ ├── LineDashType.cs │ │ ├── PathChangeReason.cs │ │ ├── ShapeFillType.cs │ │ ├── ShapePaintType.cs │ │ ├── ShapePropertyType.cs │ │ ├── ShapePropertyValueType.cs │ │ ├── TextAttr.cs │ │ ├── ToolCursorType.cs │ │ └── ToolType.cs │ ├── ipc │ │ ├── AdItemType.cs │ │ ├── Audio.cs │ │ ├── ColorEx.cs │ │ ├── Direction.cs │ │ ├── ItemBase.cs │ │ ├── Picture.cs │ │ ├── Subtitle.cs │ │ └── Video.cs │ ├── main │ │ ├── BrokenLine.cs │ │ ├── DrawableBase.cs │ │ ├── EllipseShape.cs │ │ ├── FillableShape.cs │ │ ├── FontEx.cs │ │ ├── IndicatorArrow.cs │ │ ├── LineShape.cs │ │ ├── LocationCalc.cs │ │ ├── MarqueeLabel.cs │ │ ├── RectShape.cs │ │ ├── RoundedRectShape.cs │ │ └── StrokableShape.cs │ ├── property │ │ ├── BaseProperty.cs │ │ ├── FillableProperty.cs │ │ ├── IndicatorArrowProperty.cs │ │ ├── NotDrawableProperty.cs │ │ ├── PropertyCollector.cs │ │ ├── RoundedRectProperty.cs │ │ └── StrokableProperty.cs │ └── structs │ │ └── DraggableHotSpot.cs │ └── app.config ├── IPAddressBox ├── Actions-edit-rename-icon.bmp ├── Actions-edit-rename-icon.jpg ├── IPAddressBox.csproj ├── IPAddressBoxs.cs ├── IPAddressBoxs.resx ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Actions-edit-rename-icon.bmp │ ├── CheckList.ico │ └── Security-Warning-Shield-icon.ico └── connection.ico ├── InfoSender.sln ├── LICENSE ├── MaterialSkin ├── Animations │ ├── AnimationDirection.cs │ ├── AnimationManager.cs │ └── Animations.cs ├── ColorScheme.cs ├── Controls │ ├── MaterialCheckbox.cs │ ├── MaterialContextMenuStrip.cs │ ├── MaterialDivider.cs │ ├── MaterialFlatButton.cs │ ├── MaterialForm.cs │ ├── MaterialLabel.cs │ ├── MaterialListView.cs │ ├── MaterialMenuStrip.cs │ ├── MaterialProgressBar.cs │ ├── MaterialRadioButton.cs │ ├── MaterialRaisedButton.cs │ ├── MaterialSingleLineTextField.cs │ ├── MaterialTabControl.cs │ └── MaterialTabSelector.cs ├── DrawHelper.cs ├── IMaterialControl.cs ├── MaterialSkin.csproj ├── MaterialSkinManager.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── README.md ├── TextSender ├── AdScene.cs ├── AdZip.cs ├── AddBackgroud.Designer.cs ├── AddBackgroud.cs ├── AddBackgroud.en.resx ├── AddBackgroud.resx ├── App.config ├── App.cs ├── BgTemplate.Designer.cs ├── BgTemplate.cs ├── BgTemplate.en.resx ├── BgTemplate.resx ├── Box.cs ├── BoxCtrl.Designer.cs ├── BoxCtrl.cs ├── BoxCtrl.en.resx ├── BoxCtrl.resx ├── ControlMoverOrResizer.cs ├── ExportPro.cs ├── FFMPEG.cs ├── IAdUserControl.cs ├── InputText.Designer.cs ├── InputText.cs ├── InputText.en.resx ├── InputText.resx ├── MarqueeProgress.Designer.cs ├── MarqueeProgress.cs ├── MarqueeProgress.resx ├── NLog.config ├── NetUtils.cs ├── Program.cs ├── ProgramRelease.Designer.cs ├── ProgramRelease.cs ├── ProgramRelease.en.resx ├── ProgramRelease.resx ├── ProgressForm.Designer.cs ├── ProgressForm.cs ├── ProgressForm.en.resx ├── ProgressForm.resx ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resource1.Designer.cs ├── Resource1.en.Designer.cs ├── Resource1.en.resx ├── Resource1.resx ├── Resources │ ├── 1.png │ ├── 16.png │ ├── Actions-go-next-view-icon.png │ ├── Actions-go-previous-view-icon.png │ ├── Actions-insert-text-icon.png │ ├── Clock-icon.png │ ├── Cursor-Move-icon.png │ ├── Editing-Bold-icon.png │ ├── Editing-Italic-icon.png │ ├── Editing-Underline-icon (1).png │ ├── Editing-Underline-icon.png │ ├── Editing-Underline-icon1.png │ ├── File-Video-icon.png │ ├── Files-New-File-icon.png │ ├── ID-icon.png │ ├── Images-icon.png │ ├── Images-icon1.png │ ├── Link-icon.png │ ├── Modify-icon.png │ ├── Pictures-icon.png │ ├── Rename-icon.png │ ├── Status-audio-volume-high-icon.png │ ├── Text-bold-icon.png │ ├── Text-itailc-icon.png │ ├── anti_false.png │ ├── anti_true.png │ ├── arrow-left-icon.png │ ├── arrow-right-icon.png │ ├── cap_circle_left.png │ ├── cap_circle_right.png │ ├── cap_rect_left.png │ ├── cap_rect_right.png │ ├── cap_round_left.png │ ├── cap_round_right.png │ ├── cap_square_left.png │ ├── cap_square_right.png │ ├── copy-icon.png │ ├── dash-dot.png │ ├── dash.png │ ├── dash2.png │ ├── dash_dot_dot.png │ ├── delete-icon.png │ ├── delete-icon1.png │ ├── dot.png │ ├── fill.png │ ├── film-add-icon.png │ ├── full-screen-icon.png │ ├── hexagon-icon.png │ ├── icon175x175.png │ ├── image-add-icon.png │ ├── line_arrow_left.png │ ├── line_arrow_right.png │ ├── move-icon.png │ ├── normal_arrow_left.png │ ├── normal_arrow_right.png │ ├── pan.cur │ ├── photos-icon.png │ ├── q (1).png │ ├── q (2).png │ ├── q (3).png │ ├── rotate.cur │ ├── rr.png │ ├── select.cur │ ├── select2.cur │ ├── seo-chain-link-icon.png │ ├── shape-move-back-icon.png │ ├── sharp_arrow2_left.png │ ├── sharp_arrow2_right.png │ ├── sharp_arrow_left.png │ ├── sharp_arrow_right.png │ ├── sign-left-icon.png │ ├── sign-right-icon.png │ ├── size_0.cur │ ├── size_90.cur │ ├── solid.png │ ├── symbol-check-icon.png │ ├── symbol-delete-icon.png │ ├── text-icon.png │ ├── text-icon1.png │ ├── text.png │ ├── tool_ellipse.cur │ ├── tool_line.cur │ ├── tool_rect.cur │ └── video-camera-icon.png ├── SetSceneTiming.Designer.cs ├── SetSceneTiming.cs ├── SetSceneTiming.en.resx ├── SetSceneTiming.resx ├── Singleton.cs ├── TextSender.csproj ├── comm │ ├── AdProgram.cs │ ├── Cmd.cs │ ├── Command.cs │ └── Scene.cs ├── commom │ ├── BluCodec.cs │ ├── IniFile.cs │ ├── InvokeHelper.cs │ ├── Log.cs │ ├── Profile.cs │ ├── SQLiteDBHelper.cs │ └── Util.cs ├── control │ ├── GroupBoxEx.cs │ ├── SubtitleCtrl.cs │ ├── ToolStripColorPickerDropDown.cs │ ├── ToolStripColorPickerDropDown.resx │ └── ToolStripColorPickerSplitButton.cs ├── ffmpeg.exe ├── frmAddPicture.Designer.cs ├── frmAddPicture.cs ├── frmAddPicture.en.resx ├── frmAddPicture.resx ├── frmHome.Designer.cs ├── frmHome.cs ├── frmHome.en.resx ├── frmHome.resx ├── frmHome.zh-Hans.resx ├── frmHome.zh.resx ├── frmMain.Designer.cs ├── frmMain.ad.cs ├── frmMain.bg.cs ├── frmMain.canvas.cs ├── frmMain.cs ├── frmMain.en.resx ├── frmMain.resx ├── frmMain.scene.cs ├── frmMain.subtitle.cs ├── frmMain.zh-Hant.resx ├── frmSetTime.Designer.cs ├── frmSetTime.cs ├── frmSetTime.en.resx ├── frmSetTime.resx ├── frmSetVolume.Designer.cs ├── frmSetVolume.cs ├── frmSetVolume.en.resx ├── frmSetVolume.resx ├── info-icon.png.ico ├── msyh.ttf ├── network │ ├── BoradcastIP.cs │ ├── FileServer.cs │ ├── ThreadPoolTcpSrvr.cs │ └── ThreadedTcpSrvr.cs ├── packages.config ├── pingfang.ttf ├── readme.rtf ├── rs232.cs ├── screen_def.png ├── template │ ├── image001.png │ ├── image002.png │ ├── image003.png │ ├── image004.png │ ├── image005.png │ └── image006.png └── toast │ ├── FormAnimator.cs │ ├── NativeMethods.cs │ ├── Notification.cs │ ├── Notification.designer.cs │ └── Notification.resx ├── bin-release └── Release.zip ├── ffmpeg.exe ├── info-icon.png.ico ├── screen_def.png ├── ttf ├── msyh.ttf └── pingfang.ttf └── windows-toast-notifications-master ├── .gitignore ├── README.md ├── ToastNotifications ├── FormAnimator.cs ├── NativeMethods.cs ├── Notification.cs ├── Notification.designer.cs ├── Notification.resx ├── NotificationInfo.cs ├── NotificationLauncher.Designer.cs ├── NotificationLauncher.cs ├── NotificationLauncher.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Sounds │ ├── cityscape.wav │ ├── festival.wav │ ├── garden.wav │ ├── heritage.wav │ ├── landscape.wav │ ├── normal.wav │ ├── savanna.wav │ └── sonata.wav └── ToastNotifications.csproj └── WindowsToastNotifications.sln /ExtendedPaint/ExtendedPaint.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtendedPaint", "ExtendedPaint\ExtendedPaint.csproj", "{57CDE75A-9496-4334-8F4B-ECE29DA316FD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Debug|x86.ActiveCfg = Debug|x86 15 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Debug|x86.Build.0 = Debug|x86 16 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Release|x86.ActiveCfg = Release|x86 17 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Release|x86.Build.0 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/ColorSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public partial class ColorSelector : UserControl 8 | { 9 | private static readonly Color SelectedBackColor = Color.FromArgb(255, 221, 138); 10 | 11 | private EventHandler stroke_handler; 12 | private EventHandler fill_handler; 13 | 14 | public event EventHandler StrokeColorChange 15 | { 16 | add { stroke_handler = value; } 17 | remove { stroke_handler = null; } 18 | } 19 | 20 | public event EventHandler FillColorChange 21 | { 22 | add { fill_handler = value; } 23 | remove { fill_handler = null; } 24 | } 25 | 26 | private bool _strokeSelected = true; 27 | private Color _strokeColor; 28 | private Color _fillColor; 29 | 30 | public ColorSelector() 31 | { 32 | InitializeComponent(); 33 | 34 | _strokeColor = Color.Black; 35 | _fillColor = Color.White; 36 | 37 | panel1.BackColor = SelectedBackColor; 38 | } 39 | 40 | public Color StrokeColor 41 | { 42 | get { return lblStroke.BackColor; } 43 | set { lblStroke.BackColor = value; } 44 | } 45 | 46 | public Color FillColor 47 | { 48 | get { return lblFill.BackColor; } 49 | set { lblFill.BackColor = value; } 50 | } 51 | 52 | private void ColorSelector_Load(object sender, EventArgs e) 53 | { 54 | 55 | } 56 | 57 | private void panel1_Click(object sender, EventArgs e) 58 | { 59 | _strokeSelected = true; 60 | panel1.BackColor = SelectedBackColor; 61 | panel2.BackColor = this.BackColor; 62 | } 63 | 64 | private void panel2_Click(object sender, EventArgs e) 65 | { 66 | _strokeSelected = false; 67 | panel2.BackColor = SelectedBackColor; 68 | panel1.BackColor = this.BackColor; 69 | } 70 | 71 | private void label3_Click(object sender, EventArgs e) 72 | { 73 | Label lb = (Label)sender; 74 | if (_strokeSelected) 75 | { 76 | lblStroke.BackColor = lb.BackColor; 77 | if (stroke_handler != null) 78 | stroke_handler(this, EventArgs.Empty); 79 | } 80 | else 81 | { 82 | lblFill.BackColor = lb.BackColor; 83 | if (fill_handler != null) 84 | fill_handler(this, EventArgs.Empty); 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Core/CursorsHolder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class CursorsHolder 8 | { 9 | private Cursor _pan; 10 | private Cursor _line; 11 | private Cursor _rect; 12 | private Cursor _ellipse; 13 | private Cursor _rotate; 14 | private Cursor _size_0; 15 | private Cursor _size_90; 16 | private Cursor _select; 17 | private Cursor _select2; 18 | 19 | private static volatile CursorsHolder instance; 20 | private static object syncRoot = new Object(); 21 | 22 | public static CursorsHolder Instance 23 | { 24 | get 25 | { 26 | if (instance == null) 27 | { 28 | lock (syncRoot) 29 | { 30 | if (instance == null) 31 | instance = new CursorsHolder(); 32 | } 33 | } 34 | 35 | return instance; 36 | } 37 | } 38 | 39 | private CursorsHolder() 40 | { 41 | List listCursor = new List(); 42 | List listByte = new List(); 43 | 44 | listByte.Add(Properties.Resources.pan); 45 | listByte.Add(Properties.Resources.tool_line); 46 | listByte.Add(Properties.Resources.tool_rect); 47 | listByte.Add(Properties.Resources.tool_ellipse); 48 | listByte.Add(Properties.Resources.rotate); // 49 | listByte.Add(Properties.Resources.rotate); //size_0); 50 | listByte.Add(Properties.Resources.rotate); //size_90); 51 | listByte.Add(Properties.Resources.select); 52 | listByte.Add(Properties.Resources.select2); 53 | 54 | for (int i = 0; i < listByte.Count; i++) 55 | { 56 | using (System.IO.MemoryStream ms = new System.IO.MemoryStream(listByte[i])) 57 | { 58 | listCursor.Add(new Cursor(ms)); 59 | } 60 | } 61 | 62 | _pan = listCursor[0]; 63 | _line = listCursor[1]; 64 | _rect = listCursor[2]; 65 | _ellipse = listCursor[3]; 66 | _rotate = listCursor[4]; 67 | _size_0 = listCursor[5]; 68 | _size_90 = listCursor[6]; 69 | _select = listCursor[7]; 70 | _select2 = listCursor[8]; 71 | 72 | //_pan = new Cursor(typeof(Cursor), "pan"); 73 | //_line = new Cursor(typeof(Cursor), "tool_line"); 74 | //_rect = new Cursor(typeof(Cursor), "tool_rect"); 75 | //_ellipse = new Cursor(typeof(Cursor), "tool_ellipse"); 76 | //_rotate = new Cursor(typeof(Cursor), "rotate"); 77 | //_size_0 = new Cursor(typeof(Cursor), "size_0"); 78 | //_size_90 = new Cursor(typeof(Cursor), "size_90"); 79 | //_select = new Cursor(typeof(Cursor), "select"); 80 | //_select2 = new Cursor(typeof(Cursor), "select2"); 81 | } 82 | 83 | public Cursor Pan { get { return _pan; } } 84 | public Cursor ToolLine { get { return _line; } } 85 | public Cursor ToolRect { get { return _rect; } } 86 | public Cursor ToolEllipse { get { return _ellipse; } } 87 | //publiic Cursor Rotate { get { return _rotate; } } 88 | public Cursor Size0 { get { return _size_0; } } 89 | public Cursor Size90 { get { return _size_90; } } 90 | public Cursor Select { get { return _select; } } 91 | public Cursor Select2 { get { return _select2; } } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Core/EPConst.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace Gdu.ExtendedPaint 5 | { 6 | public class EPConst 7 | { 8 | public static readonly Pen Pen_Hit_Detect; 9 | public const int Pen_Hit_Width = 14; 10 | public const int Acceptable_Min_Move_Distance = 4; 11 | public const int Anchor_Rect_Half_Width = 3; 12 | public const int Line_Vertex_Half_Width = 5; 13 | public const int RotatingRect_Offset = 60; 14 | public const int RotatingRect_Half_Width = 12; 15 | public const int CrossSign_Half_Width = 2; 16 | public const float MagicBezier = 0.55f; 17 | public const int Max_Stroke_Width = 120; 18 | 19 | static EPConst() 20 | { 21 | Pen_Hit_Detect = new Pen(Color.Black, Pen_Hit_Width); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/FormAbout.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace Gdu.ExtendedPaint 5 | { 6 | public partial class FormAbout : Form 7 | { 8 | public FormAbout() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void FormAbout_Load(object sender, EventArgs e) 14 | { 15 | 16 | } 17 | 18 | private void button1_Click(object sender, EventArgs e) 19 | { 20 | this.Close(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Helpers/DrawHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public static class DrawHelper 8 | { 9 | public static void DrawCrossSign(Graphics g, PointF pt, int width) 10 | { 11 | SmoothingMode old = g.SmoothingMode; 12 | g.SmoothingMode = SmoothingMode.AntiAlias; 13 | g.DrawLine(Pens.Blue, pt.X - width, pt.Y - width, pt.X + width, pt.Y + width); 14 | g.DrawLine(Pens.Blue, pt.X + width, pt.Y - width, pt.X - width, pt.Y + width); 15 | g.SmoothingMode = old; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Helpers/ShapeHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public static class ShapeHelper 8 | { 9 | public static PointF[] GetIndicatorArrowPoints(PointF p1, PointF p2, IndicatorSize size) 10 | { 11 | int hw = 0; 12 | float tw = 0; 13 | 14 | switch (size) 15 | { 16 | case IndicatorSize.Small: 17 | hw = 10; 18 | tw = 0.8f; 19 | break; 20 | case IndicatorSize.Medium: 21 | hw = 16; 22 | tw = 0.8f; 23 | break; 24 | case IndicatorSize.Large: 25 | hw = 22; 26 | tw = 0.8f; 27 | break; 28 | } 29 | 30 | PointF[] pf = new PointF[7]; 31 | PointF tmp = new PointF(); 32 | double angle = Math.Atan2(p2.Y - p1.Y, p2.X - p1.X); 33 | tmp.X = p2.X + (float)(hw * Math.Cos(angle + Math.PI)); 34 | tmp.Y = p2.Y + (float)(hw * Math.Sin(angle + Math.PI)); 35 | 36 | pf[0] = new PointF( 37 | p1.X + (float)(tw * Math.Cos(angle - Math.PI / 2)), 38 | p1.Y + (float)(tw * Math.Sin(angle - Math.PI / 2))); 39 | pf[6] = new PointF( 40 | p1.X + (float)(tw * Math.Cos(angle + Math.PI / 2)), 41 | p1.Y + (float)(tw * Math.Sin(angle + Math.PI / 2))); 42 | 43 | pf[3] = p2; 44 | 45 | pf[1] = new PointF( 46 | tmp.X + (float)(hw / 4 * Math.Cos(angle - Math.PI / 2)), 47 | tmp.Y + (float)(hw / 4 * Math.Sin(angle - Math.PI / 2))); 48 | pf[2] = new PointF( 49 | tmp.X + (float)(hw / 2 * Math.Cos(angle - Math.PI / 2)), 50 | tmp.Y + (float)(hw / 2 * Math.Sin(angle - Math.PI / 2))); 51 | pf[4] = new PointF( 52 | tmp.X + (float)(hw / 2 * Math.Cos(angle + Math.PI / 2)), 53 | tmp.Y + (float)(hw / 2 * Math.Sin(angle + Math.PI / 2))); 54 | pf[5] = new PointF( 55 | tmp.X + (float)(hw / 4 * Math.Cos(angle + Math.PI / 2)), 56 | tmp.Y + (float)(hw / 4 * Math.Sin(angle + Math.PI / 2))); 57 | 58 | return pf; 59 | } 60 | 61 | public static PointF[] GetRoundedRectPathPoints(int radius, PointF pt0, PointF pt2) 62 | { 63 | PointF[] pf = new PointF[16]; 64 | PointF pt1 = new PointF(pt2.X, pt0.Y); 65 | PointF pt3 = new PointF(pt0.X, pt2.Y); 66 | 67 | float magic = 0.55f; 68 | float len = radius * magic; 69 | 70 | pf[0] = new PointF(pt0.X, pt0.Y + radius); 71 | pf[1] = new PointF(pt0.X, pf[0].Y - len); 72 | pf[3] = new PointF(pt0.X + radius, pt0.Y); 73 | pf[2] = new PointF(pf[3].X - len, pt0.Y); 74 | 75 | pf[4] = new PointF(pt1.X - radius, pt1.Y); 76 | pf[5] = new PointF(pf[4].X + len, pt1.Y); 77 | pf[7] = new PointF(pt1.X, pt1.Y + radius); 78 | pf[6] = new PointF(pt1.X, pf[7].Y - len); 79 | 80 | pf[8] = new PointF(pt2.X, pt2.Y - radius); 81 | pf[9] = new PointF(pt2.X, pf[8].Y + len); 82 | pf[11] = new PointF(pt2.X - radius, pt2.Y); 83 | pf[10] = new PointF(pf[11].X + len, pt2.Y); 84 | 85 | pf[12] = new PointF(pt3.X + radius, pt3.Y); 86 | pf[13] = new PointF(pf[12].X - len, pt3.Y); 87 | pf[15] = new PointF(pt3.X, pt3.Y - radius); 88 | pf[14] = new PointF(pt3.X, pf[15].Y + len); 89 | 90 | return pf; 91 | } 92 | 93 | public static PointF[] GetBrokenLinePoints(Point p1, Point p2) 94 | { 95 | float dx = p2.X - p1.X; 96 | float dy = p2.Y - p1.Y; 97 | float length = (float)Math.Sqrt(dx * dx + dy * dy); 98 | double angle = Math.Atan2(p2.Y - p1.Y, p2.X - p1.X); 99 | PointF p3 = new PointF( 100 | p1.X + (float)(length / 3 * Math.Cos(angle)), 101 | p1.Y + (float)(length / 3 * Math.Sin(angle))); 102 | PointF p4 = new PointF( 103 | p1.X + (float)(length / 3 * 2 * Math.Cos(angle)), 104 | p1.Y + (float)(length / 3 * 2 * Math.Sin(angle))); 105 | return new PointF[] { p1, p3, p4, p2 }; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace Gdu.ExtendedPaint 5 | { 6 | static class Program 7 | { 8 | /// 9 | /// 应用程序的主入口点。 10 | /// 11 | [STAThread] 12 | static void Main() 13 | { 14 | Application.EnableVisualStyles(); 15 | Application.SetCompatibleTextRenderingDefault(false); 16 | Application.Run(new FormMain()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ExtendedPaint")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ExtendedPaint")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("e6478cd7-7147-4d2b-877a-067a7662c29d")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 内部版本号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.34209 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Gdu.ExtendedPaint.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/anti_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/anti_false.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/anti_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/anti_true.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_circle_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_circle_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_circle_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_circle_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_rect_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_rect_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_rect_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_rect_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_round_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_round_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_round_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_round_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_square_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_square_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/cap_square_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/cap_square_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/dash-dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/dash-dot.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/dash.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/dash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/dash2.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/dash_dot_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/dash_dot_dot.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/dot.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/line_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/line_arrow_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/line_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/line_arrow_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/normal_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/normal_arrow_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/normal_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/normal_arrow_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/pan.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/pan.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/rotate.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/rotate.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/select.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/select.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/select2.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/select2.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/sharp_arrow2_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/sharp_arrow2_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/sharp_arrow2_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/sharp_arrow2_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/sharp_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/sharp_arrow_left.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/sharp_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/sharp_arrow_right.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/size_0.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/size_0.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/size_90.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/size_90.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/solid.png -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/tool_ellipse.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/tool_ellipse.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/tool_line.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/tool_line.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Resources/tool_rect.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Resources/tool_rect.cur -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/common/CircleCap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class CircleCap : CustomLineCap 8 | { 9 | public CircleCap() 10 | : this(5.0f, 5.0f) 11 | { 12 | } 13 | 14 | public CircleCap(float width, float height) 15 | : base(getFillPath(width, height), null) 16 | { 17 | } 18 | 19 | private static GraphicsPath getFillPath(float w, float h) 20 | { 21 | GraphicsPath path = new GraphicsPath(); 22 | path.AddEllipse(new RectangleF(-h / 2, -w / 2, h, w)); 23 | return path; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/common/LineArrowCap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class LineArrowCap : CustomLineCap 8 | { 9 | public LineArrowCap() 10 | : this(7.0f, 7.0f) 11 | { 12 | } 13 | 14 | public LineArrowCap(float width, float height) 15 | : base(null, getFillPath(width, height)) 16 | { 17 | base.BaseInset = 1.0f; 18 | } 19 | 20 | private static GraphicsPath getFillPath(float w, float h) 21 | { 22 | GraphicsPath path = new GraphicsPath(); 23 | path.AddLine(0, 0, h / 2, -w); 24 | path.AddLine(0, 0, -h / 2, -w); 25 | return path; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/common/RectangleCap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class RectangleCap : CustomLineCap 8 | { 9 | public RectangleCap() 10 | : this(4.0f, 4.0f) 11 | { 12 | } 13 | 14 | public RectangleCap(float width, float height) 15 | : base(getFillPath(width, height), null) 16 | { 17 | } 18 | 19 | private static GraphicsPath getFillPath(float w, float h) 20 | { 21 | GraphicsPath path = new GraphicsPath(); 22 | path.AddRectangle(new RectangleF(-h / 2, -w / 2, h, w)); 23 | return path; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/common/SharpArrowCap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class SharpArrowCap : CustomLineCap 8 | { 9 | public SharpArrowCap() 10 | : this(6.8f, 5.2f, 3.6f) 11 | { 12 | } 13 | 14 | public SharpArrowCap(float width, float height, float sharpIn) 15 | : base(getFillPath(width,height, sharpIn), null) 16 | { 17 | base.BaseInset = 2.0f; 18 | } 19 | 20 | private static GraphicsPath getFillPath(float w, float h, float sharp) 21 | { 22 | GraphicsPath path = new GraphicsPath(); 23 | PointF p1 = new PointF(0, 0); 24 | PointF p2 = new PointF(-h / 2, -w); 25 | PointF p3 = new PointF(0, -sharp); 26 | PointF p4 = new PointF(h / 2, -w); 27 | path.AddLines(new PointF[] { p1, p2, p3, p4 }); 28 | path.CloseFigure(); 29 | return path; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/HotSpotType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum HotSpotType 6 | { 7 | LineVertex, 8 | //RotatingRect, 9 | AnchorToScale 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/IndicatorSize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum IndicatorSize 6 | { 7 | Small, 8 | Medium, 9 | Large 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/LineCapType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum LineCapType 6 | { 7 | Square, 8 | Rounded, 9 | Rectangle, 10 | Circle, 11 | LineArrow, 12 | NormalArrow, 13 | SharpArrow, 14 | SharpArrow2, 15 | Hip 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/LineDashType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum LineDashType 6 | { 7 | Solid, 8 | DashedDot, 9 | DashedDotDot, 10 | Dot, 11 | Dash1, 12 | Dash2 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/PathChangeReason.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum PathTransformType 6 | { 7 | Move, 8 | Scale, 9 | Rotate 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/ShapeFillType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum ShapeFillType 6 | { 7 | SolidColor, 8 | LinearGradient, 9 | PathGradient 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/ShapePaintType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum ShapePaintType 6 | { 7 | Stroke, 8 | Fill, 9 | StrokeAndFill 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/ShapePropertyType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum ShapePropertyType 6 | { 7 | NotDrawable, 8 | StrokableProperty, 9 | FillableProperty, 10 | IndicatorArrowProperty, 11 | RoundedRectProperty 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/ShapePropertyValueType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum ShapePropertyValueType 6 | { 7 | Antialias, 8 | 9 | StrokeWidth, 10 | StrokeColor, 11 | LineDash, 12 | StartLineCap, 13 | EndLineCap, 14 | PenAlignment, 15 | LineJoin, 16 | 17 | PaintType, 18 | FillType, 19 | FillColor, 20 | 21 | IndicatorSize, 22 | 23 | RoundedRadius 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/TextAttr.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum TextProperty 6 | { 7 | FontName, 8 | FontSize, 9 | Bold, 10 | Italic, 11 | Underline, 12 | Direction, 13 | Speed, 14 | Text, 15 | FontColor, 16 | BackColor, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/ToolCursorType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum ToolCursorType 6 | { 7 | Default, 8 | LineTool, 9 | RectTool, 10 | EllipseTool, 11 | HandTool, 12 | ShapeSelect_Default, 13 | 14 | ShapeSelect_Move, 15 | //ShapeSelect_Rotate, 16 | ShapeSelect_Scale_0, 17 | ShapeSelect_Scale_90, 18 | ShapeSelect_Scale_45, 19 | ShapeSelect_Scale_135, 20 | ShapeSelect_DragLineVertex, 21 | 22 | CustomTool 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/enums/ToolType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public enum ToolType 6 | { 7 | Hand, 8 | Line, 9 | BrokenLine, 10 | IndicatorArrow, 11 | Rectangle, 12 | RoundedRect, 13 | Ellipse, 14 | ShapeSelect, 15 | Custom 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/AdItemType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | public enum AdItemType 5 | { 6 | Video, 7 | Picture, 8 | Subtitle, 9 | Select, 10 | } 11 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/Audio.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | 9 | public class Audio : ItemBase 10 | { 11 | public int intval = -1; 12 | public List filelist = new List(); 13 | 14 | public Audio() 15 | { 16 | type = "audio"; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/ColorEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | public class ColorEx 5 | { 6 | 7 | public static string ColorToHex(Color c) 8 | { 9 | string hex = "#" + c.A.ToString("X2") + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2"); 10 | Console.WriteLine(c.ToString() + " => " + hex); 11 | return hex; 12 | } 13 | 14 | // hex format : #AARRGGBB 15 | public static Color FromHtml(string hex) 16 | { 17 | //If the original colour was a custom colour (not a known colour) then 18 | //the stored colour will contain a HTML-string, like "ff12aadd". 19 | 20 | //Ignore the first two characters (the alpha) and hope 21 | //that all custom colours uses "ff" as alpha. 22 | Color c = ColorTranslator.FromHtml("#" + hex.Substring(3)); 23 | //Color colour = ColorTranslator.FromHtml("#E7EFF2"); 24 | Color colorAlpha = Color.FromArgb(Convert.ToInt32("0x" + hex.Substring(1, 2), 16), c); 25 | Console.WriteLine(hex + " => " + colorAlpha.ToString()); 26 | 27 | return colorAlpha; 28 | } 29 | 30 | 31 | } -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/Direction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | 9 | 10 | public enum Direction 11 | { 12 | ToLeft, 13 | ToRight, 14 | Static 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/ItemBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Net; 5 | using System.Net.Sockets; 6 | using System.Text; 7 | using System.Threading; 8 | 9 | public class ItemBase 10 | { 11 | //保存按 1920*1080 计算的屏幕坐标 12 | public int x; 13 | public int y; 14 | public int w; 15 | public int h; 16 | 17 | // form 上面的坐标位置. 左上角 18 | public float fx; 19 | public float fy; 20 | // form 上面的坐标位置. 右下角 21 | public float fx1; 22 | public float fy1; 23 | 24 | public string type; 25 | 26 | public override string ToString() 27 | { 28 | return "type: " + type + " " + x + " " + y + " " + w + " " + h; 29 | } 30 | } -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/Picture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | 9 | 10 | public class Picture : ItemBase, ICloneable 11 | { 12 | public int intval = -1; 13 | public List filelist = new List(); 14 | public Picture() 15 | { 16 | type = "picture"; 17 | } 18 | 19 | public object Clone() 20 | { 21 | return this.MemberwiseClone(); //浅复制 22 | } 23 | } -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/Subtitle.cs: -------------------------------------------------------------------------------- 1 | using Gdu.ExtendedPaint; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Net; 6 | using System.Net.Sockets; 7 | using System.Text; 8 | using System.Threading; 9 | 10 | 11 | 12 | public class Subtitle : ItemBase 13 | { 14 | public string fontname; 15 | public int fontsize; 16 | public bool bold; 17 | public bool italic; 18 | public bool underline; 19 | public bool transparent; //背景完全透明 优先级比 backcolor 高 20 | public int opacity; // 背景不透明度, 0 - 100, 0 完全透明 21 | public Direction direction; // 012 三个值, 取值2时,文字居中显示 22 | public int speed; 23 | public string text; 24 | public string fontcolor; // #AARRGGBB 25 | public string backcolor; 26 | 27 | public Subtitle() 28 | { 29 | type = "subtitle"; 30 | fontname = "simsun.ttf"; 31 | fontsize = 30; 32 | bold = false; 33 | italic = false; 34 | underline = false; 35 | transparent = false; //优先级比 backcolor 高 36 | opacity = 100; 37 | direction = Direction.ToLeft; // r2l l2r static; 012 三个值; 取值2时;文字居中显示 38 | speed = 7; 39 | text = "请在 字幕内容 区输入字幕( 双击放大)"; 40 | fontcolor = "#FFFFFFFF"; 41 | backcolor = "#FF3CA7C7"; 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/ipc/Video.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | 9 | public class Video : ItemBase 10 | { 11 | public int intval = -1; 12 | public List filelist = new List(); 13 | public Video() 14 | { 15 | type = "video"; 16 | } 17 | 18 | public object Clone() 19 | { 20 | return this.MemberwiseClone(); //浅复制 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/main/BrokenLine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class BrokenLine : StrokableShape 8 | { 9 | private DraggableHotSpot[] _hotspots; 10 | 11 | public BrokenLine(EPKernel container, StrokableProperty pro) 12 | :base(container, pro) 13 | { 14 | _hotspots = new DraggableHotSpot[4]; 15 | for (int i = 0; i < 4; i++) 16 | _hotspots[i] = new DraggableHotSpot(HotSpotType.LineVertex); 17 | } 18 | 19 | public override ToolType Type 20 | { 21 | get { return ToolType.BrokenLine; } 22 | } 23 | 24 | public override string ReadableName 25 | { 26 | get { return "折线"; } 27 | } 28 | 29 | public override void SetEndPoint(Point pt) 30 | { 31 | if (IsInCreating) 32 | { 33 | base.BeforePathTransforming(); 34 | base.Path.Reset(); 35 | base.Path.AddLine(base.StartPoint, pt); 36 | AfterPathTransformed(PathTransformType.Scale, true); 37 | } 38 | else 39 | { 40 | PointF[] pf = ShapeHelper.GetBrokenLinePoints(StartPoint, pt); 41 | base.SetNewScaledPath(pf, new byte[] { 0, 1, 1, 1 }); 42 | } 43 | } 44 | 45 | public override void SetNewPosForHotAnchor(int index, Point newPos) 46 | { 47 | PointF[] pf = base.Path.PathPoints; 48 | pf[index] = newPos; 49 | base.SetNewScaledPath(pf, new byte[] { 0, 1, 1, 1 }); 50 | } 51 | 52 | protected override void RecalculateDraggableHotSpots() 53 | { 54 | PointF[] pf = Path.PathPoints; 55 | int hw = EPConst.Anchor_Rect_Half_Width; 56 | int w = hw * 2; 57 | for (int i = 0; i < _hotspots.Length; i++) 58 | _hotspots[i].Rect = new Rectangle((int)(pf[i].X - hw), (int)(pf[i].Y - hw), w, w); 59 | } 60 | 61 | public override DraggableHotSpot[] DraggableHotSpots 62 | { 63 | get { return _hotspots; } 64 | } 65 | 66 | public override void DrawSelectedRect(Graphics g, bool withAnchors) 67 | { 68 | SmoothingMode old = g.SmoothingMode; 69 | g.SmoothingMode = SmoothingMode.HighSpeed; 70 | for (int i = 0; i < _hotspots.Length; i++) 71 | { 72 | g.FillRectangle(Brushes.White, _hotspots[i].Rect); 73 | g.DrawRectangle(Pens.Black, _hotspots[i].Rect); 74 | } 75 | g.SmoothingMode = old; 76 | } 77 | 78 | public override bool AnyPointContainedByRect(Rectangle rect) 79 | { 80 | PointF[] pf = Path.PathPoints; 81 | for (int i = 0; i < pf.Length - 1; i++) 82 | { 83 | Point linePt1 = new Point((int)pf[i].X, (int)pf[i].Y); 84 | Point linePt2 = new Point((int)pf[i + 1].X, (int)pf[i + 1].Y); 85 | if (GeometricHelper.RectContainsPointOnLine(rect, linePt1, linePt2)) 86 | return true; 87 | } 88 | return false; 89 | } 90 | 91 | public override bool ContainsPoint(Point pos) 92 | { 93 | return base.Path.IsOutlineVisible(pos, EPConst.Pen_Hit_Detect); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/main/EllipseShape.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class EllipseShape : RectShape 8 | { 9 | public EllipseShape(EPKernel container, FillableProperty pro) 10 | : base(container, pro) 11 | { } 12 | 13 | public override ToolType Type 14 | { 15 | get { return ToolType.Ellipse; } 16 | } 17 | 18 | public override string ReadableName 19 | { 20 | get { return "椭圆"; } 21 | } 22 | 23 | public override void SetNewPosForHotAnchor(int index, Point newPos) 24 | { 25 | if (index == DraggableHotSpots.Length - 1) 26 | { 27 | base.Rotate(newPos); 28 | } 29 | else 30 | { 31 | //PointF[] pf = TransformHelper.GetScaledEllipsePathPoints(base.Path, index, newPos, false); 32 | PointF[] pf = ScaleHelper.GetScaledEllipsePathPoints(base.Path, index, newPos, false, 33 | TopSideAngle, RightSideAngle); 34 | base.SetNewScaledPath(pf); 35 | } 36 | LastTransformPoint = newPos; 37 | } 38 | 39 | /// 40 | /// reset center point, rotate point, corner/side anchors, top/right side angle 41 | /// 42 | protected override void ResetPathExtraInfo(PathTransformType transType) 43 | { 44 | PointF[] pf = base.Path.PathPoints; 45 | PointF[] corner = new PointF[4]; 46 | PointF[] side = new PointF[4]; 47 | 48 | base.CenterPoint = new PointF((pf[6].X + pf[0].X) / 2, (pf[9].Y + pf[3].Y) / 2); 49 | 50 | side[0] = pf[9]; 51 | side[1] = pf[0]; 52 | side[2] = pf[3]; 53 | side[3] = pf[6]; 54 | 55 | float rdx = pf[0].X - CenterPoint.X; 56 | float rdy = pf[0].Y - CenterPoint.Y; 57 | float ldx = pf[6].X - CenterPoint.X; 58 | float ldy = pf[6].Y - CenterPoint.Y; 59 | 60 | corner[0] = new PointF(pf[9].X + ldx, pf[9].Y + ldy); 61 | corner[1] = new PointF(pf[9].X + rdx, pf[9].Y + rdy); 62 | corner[2] = new PointF(pf[3].X + rdx, pf[3].Y + rdy); 63 | corner[3] = new PointF(pf[3].X + ldx, pf[3].Y + ldy); 64 | 65 | CornerAnchors = corner; 66 | SideAnchors = side; 67 | 68 | if (transType == PathTransformType.Rotate || transType == PathTransformType.Scale) 69 | { 70 | double tmp = Math.Atan2(pf[0].Y - pf[6].Y, pf[0].X - pf[6].X); 71 | if (tmp != 0) 72 | RightSideAngle = tmp; 73 | tmp = Math.Atan2(pf[9].Y - pf[3].Y, pf[9].X - pf[3].X); 74 | if (tmp != 0) 75 | TopSideAngle = tmp; 76 | } 77 | 78 | double angle = TopSideAngle + Math.PI; 79 | PointF rotatePoint = new PointF( 80 | (float)(pf[3].X + EPConst.RotatingRect_Offset * Math.Cos(angle)), 81 | (float)(pf[3].Y + EPConst.RotatingRect_Offset * Math.Sin(angle))); 82 | base.RotateLocation = rotatePoint; 83 | } 84 | 85 | protected override void ResetPath() 86 | { 87 | base.BeforePathTransforming(); 88 | base.Path.Reset(); 89 | base.Path.AddEllipse(base.Rect); 90 | AfterPathTransformed(PathTransformType.Scale, true); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/main/FillableShape.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public abstract class FillableShape : StrokableShape 8 | { 9 | private Brush fill_brush; 10 | private FillableProperty _pro; 11 | 12 | public FillableShape(EPKernel container, FillableProperty property) 13 | :base(container, property) 14 | { 15 | _pro = property; 16 | SetNewBrush(); 17 | } 18 | 19 | private void SetNewBrush() 20 | { 21 | if (fill_brush != null) 22 | fill_brush.Dispose(); 23 | 24 | fill_brush = new SolidBrush(_pro.FillColor); 25 | } 26 | 27 | protected override void AfterPropertyChanged(BaseProperty oldValue, BaseProperty newValue) 28 | { 29 | base.AfterPropertyChanged(oldValue, newValue); 30 | _pro = (FillableProperty)newValue; 31 | SetNewBrush(); 32 | } 33 | 34 | /// 35 | /// 给后面的子类填充用 36 | /// 37 | protected Brush FillBrush 38 | { 39 | get { return fill_brush; } 40 | } 41 | 42 | public override void Draw(Graphics g) 43 | { 44 | SmoothingMode old = g.SmoothingMode; 45 | g.SmoothingMode = (ShapeProperty.Antialias) ? SmoothingMode.AntiAlias : SmoothingMode.HighSpeed; 46 | 47 | if (_pro.PaintType == ShapePaintType.Fill || _pro.PaintType == ShapePaintType.StrokeAndFill) 48 | g.FillPath(FillBrush, base.Path); 49 | 50 | if (_pro.PaintType == ShapePaintType.Stroke || _pro.PaintType == ShapePaintType.StrokeAndFill) 51 | base.Draw(g); 52 | 53 | g.SmoothingMode = old; 54 | } 55 | 56 | #region IDisposable interface 57 | 58 | public override void Dispose() 59 | { 60 | if (fill_brush != null) 61 | fill_brush.Dispose(); 62 | 63 | base.Dispose(); 64 | } 65 | 66 | 67 | 68 | 69 | #endregion 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/main/FontEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Net; 5 | using System.Net.Sockets; 6 | using System.Text; 7 | using System.Threading; 8 | 9 | 10 | public class FontEx 11 | { 12 | 13 | private static Dictionary fontDict; // ttf 文件名称 => FontFamily 14 | private static System.Drawing.Text.PrivateFontCollection[] privateFonts; 15 | private static Dictionary ttfDict; 16 | 17 | static FontEx() 18 | { 19 | fontDict = new Dictionary(); 20 | 21 | 22 | //这些字体win 自带 23 | try 24 | { 25 | fontDict["simsun.ttf"] = new FontFamily("宋体"); 26 | fontDict["simkai.ttf"] = new FontFamily("楷体"); 27 | fontDict["simhei.ttf"] = new FontFamily("黑体"); 28 | } 29 | catch (Exception) 30 | { 31 | fontDict["simkai.ttf"] = new FontFamily("宋体"); 32 | fontDict["simhei.ttf"] = new FontFamily("宋体"); 33 | } 34 | 35 | // 这些字体 win不自带 36 | string[] fn = { "msyh.ttf", "pingfang.ttf" }; // "simkai.ttf", "simsun.ttf", "simhei.ttf", 37 | privateFonts = new System.Drawing.Text.PrivateFontCollection[fn.Length]; 38 | for (int i = 0; i < fn.Length; i++) 39 | { 40 | string ttf = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fn[i]); 41 | privateFonts[i] = new System.Drawing.Text.PrivateFontCollection(); 42 | privateFonts[i].AddFontFile(ttf); 43 | 44 | fontDict[fn[i]] = privateFonts[i].Families[0]; 45 | } 46 | 47 | //字体名称 => ttf 文件名称 48 | ttfDict = new Dictionary(); 49 | ttfDict.Add("楷体", "simkai.ttf"); 50 | ttfDict.Add("雅黑", "msyh.ttf"); 51 | ttfDict.Add("宋体", "simsun.ttf"); 52 | ttfDict.Add("黑体", "simhei.ttf"); 53 | ttfDict.Add("苹方", "pingfang.ttf"); 54 | } 55 | 56 | 57 | public static string getTtfName(string fontname) 58 | { 59 | return ttfDict[fontname]; 60 | } 61 | 62 | public static FontFamily getFontFamily(string ttfname) 63 | { 64 | return fontDict[ttfname]; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/main/IndicatorArrow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class IndicatorArrow : LineShape 8 | { 9 | private byte[] types = new byte[] { 0, 1, 1, 1, 1, 1, 0x81 }; 10 | private IndicatorArrowProperty _property; 11 | 12 | public IndicatorArrow(EPKernel container, IndicatorArrowProperty pro) 13 | :base(container, null) 14 | { 15 | _property = pro; 16 | } 17 | 18 | public override ToolType Type 19 | { 20 | get { return ToolType.IndicatorArrow; } 21 | } 22 | 23 | public override string ReadableName 24 | { 25 | get { return "提示箭头"; } 26 | } 27 | 28 | public override BaseProperty ShapeProperty 29 | { 30 | get 31 | { 32 | return _property; 33 | } 34 | set 35 | { 36 | _property = (IndicatorArrowProperty)value; 37 | 38 | // reset the size 39 | Point p = new Point((int)VertexAnchors[0].X, (int)VertexAnchors[0].Y); 40 | SetNewPosForHotAnchor(0, p); 41 | } 42 | } 43 | 44 | public override void SetEndPoint(Point pt) 45 | { 46 | PointF[] pf = ShapeHelper.GetIndicatorArrowPoints(base.StartPoint, pt, _property.LineSize); 47 | base.SetNewScaledPath(pf, types); 48 | } 49 | 50 | public override void SetNewPosForHotAnchor(int index, Point newPos) 51 | { 52 | PointF[] pf = base.VertexAnchors; 53 | pf[index] = newPos; 54 | 55 | PointF[] newps = ShapeHelper.GetIndicatorArrowPoints(pf[0], pf[1], _property.LineSize); 56 | base.SetNewScaledPath(newps, types); 57 | } 58 | 59 | //protected override void AfterPropertyChanged(BaseProperty oldValue, BaseProperty newValue) 60 | //{ 61 | // _property = (IndicatorArrowProperty)newValue; 62 | //} 63 | 64 | protected override void UpdateVertexAnchors() 65 | { 66 | PointF[] pf = Path.PathPoints; 67 | PointF[] va = new PointF[2]; 68 | va[0] = new PointF((pf[0].X + pf[6].X) / 2, (pf[0].Y + pf[6].Y) / 2); 69 | va[1] = pf[3]; 70 | VertexAnchors = va; 71 | } 72 | 73 | public override void Draw(Graphics g) 74 | { 75 | SmoothingMode old = g.SmoothingMode; 76 | g.SmoothingMode = (_property.Antialias) ? SmoothingMode.AntiAlias : SmoothingMode.HighSpeed; 77 | 78 | using (SolidBrush sb = new SolidBrush(_property.LineColor)) 79 | { 80 | g.FillPath(sb, Path); 81 | } 82 | 83 | g.SmoothingMode = old; 84 | } 85 | 86 | public override bool ContainsPoint(Point pos) 87 | { 88 | return base.Path.IsVisible(pos); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/main/LocationCalc.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/ExtendedPaint/ExtendedPaint/Shapes/main/LocationCalc.cs -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/property/BaseProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public abstract class BaseProperty 6 | { 7 | public abstract ShapePropertyType PropertyType { get; } 8 | public bool Antialias { get; set; } 9 | 10 | public BaseProperty() 11 | { 12 | Antialias = true; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/property/FillableProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace Gdu.ExtendedPaint 5 | { 6 | public class FillableProperty : StrokableProperty 7 | { 8 | public override ShapePropertyType PropertyType 9 | { 10 | get { return ShapePropertyType.FillableProperty; } 11 | } 12 | 13 | public ShapePaintType PaintType { get; set; } 14 | public ShapeFillType FillType { get; set; } 15 | public Color FillColor { get; set; } 16 | 17 | public FillableProperty() 18 | { 19 | PaintType = ShapePaintType.Stroke; 20 | FillType = ShapeFillType.SolidColor; 21 | FillColor = Color.White; 22 | } 23 | 24 | public new FillableProperty Clone() 25 | { 26 | FillableProperty fp = new FillableProperty(); 27 | fp.Antialias = this.Antialias; 28 | 29 | fp.PenWidth = this.PenWidth; 30 | fp.StrokeColor = this.StrokeColor; 31 | fp.LineDash = this.LineDash; 32 | fp.StartLineCap = this.StartLineCap; 33 | fp.EndLineCap = this.EndLineCap; 34 | fp.PenAlign = this.PenAlign; 35 | fp.HowLineJoin = this.HowLineJoin; 36 | 37 | fp.PaintType = this.PaintType; 38 | fp.FillType = this.FillType; 39 | fp.FillColor = this.FillColor; 40 | 41 | return fp; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/property/IndicatorArrowProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace Gdu.ExtendedPaint 5 | { 6 | public class IndicatorArrowProperty : BaseProperty 7 | { 8 | public override ShapePropertyType PropertyType 9 | { 10 | get { return ShapePropertyType.IndicatorArrowProperty; } 11 | } 12 | 13 | public Color LineColor { get; set; } 14 | public IndicatorSize LineSize { get; set; } 15 | 16 | public IndicatorArrowProperty() 17 | { 18 | LineColor = Color.Gray; 19 | LineSize = IndicatorSize.Large; 20 | } 21 | 22 | public IndicatorArrowProperty Clone() 23 | { 24 | IndicatorArrowProperty iap = new IndicatorArrowProperty(); 25 | iap.Antialias = this.Antialias; 26 | iap.LineColor = this.LineColor; 27 | iap.LineSize = this.LineSize; 28 | return iap; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/property/NotDrawableProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public class NotDrawableProperty : BaseProperty 6 | { 7 | public override ShapePropertyType PropertyType 8 | { 9 | get { return ShapePropertyType.NotDrawable; } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/property/RoundedRectProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gdu.ExtendedPaint 4 | { 5 | public class RoundedRectProperty : FillableProperty 6 | { 7 | public override ShapePropertyType PropertyType 8 | { 9 | get { return ShapePropertyType.RoundedRectProperty; } 10 | } 11 | 12 | public int RadiusTL { get; set; } 13 | public int RadiusTR { get; set; } 14 | public int RadiusBR { get; set; } 15 | public int RadiusBL { get; set; } 16 | public int RadiusAll { get; set; } 17 | 18 | public RoundedRectProperty() 19 | { 20 | RadiusAll = 8; 21 | RadiusTL = RadiusTR = RadiusBR = RadiusBL = 8; 22 | } 23 | 24 | public new RoundedRectProperty Clone() 25 | { 26 | RoundedRectProperty rrp = new RoundedRectProperty(); 27 | 28 | rrp.Antialias = this.Antialias; 29 | 30 | rrp.PenWidth = this.PenWidth; 31 | rrp.StrokeColor = this.StrokeColor; 32 | rrp.LineDash = this.LineDash; 33 | rrp.StartLineCap = this.StartLineCap; 34 | rrp.EndLineCap = this.EndLineCap; 35 | rrp.PenAlign = this.PenAlign; 36 | rrp.HowLineJoin = this.HowLineJoin; 37 | 38 | rrp.PaintType = this.PaintType; 39 | rrp.FillType = this.FillType; 40 | rrp.FillColor = this.FillColor; 41 | 42 | rrp.RadiusAll = this.RadiusAll; 43 | rrp.RadiusTL = this.RadiusTL; 44 | rrp.RadiusTR = this.RadiusTR; 45 | rrp.RadiusBR = this.RadiusBR; 46 | rrp.RadiusBL = this.RadiusBL; 47 | 48 | return rrp; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/property/StrokableProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | 5 | namespace Gdu.ExtendedPaint 6 | { 7 | public class StrokableProperty : BaseProperty 8 | { 9 | public override ShapePropertyType PropertyType 10 | { 11 | get { return ShapePropertyType.StrokableProperty; } 12 | } 13 | 14 | public float PenWidth { get; set; } 15 | public Color StrokeColor { get; set; } 16 | public LineDashType LineDash { get; set; } 17 | public LineCapType StartLineCap { get; set; } 18 | public LineCapType EndLineCap { get; set; } 19 | public PenAlignment PenAlign { get; set; } 20 | public LineJoin HowLineJoin { get; set; } 21 | 22 | public StrokableProperty() 23 | { 24 | PenWidth = 1.0f; 25 | StrokeColor = Color.Black; 26 | LineDash = LineDashType.Solid; 27 | StartLineCap = LineCapType.Square; 28 | EndLineCap = LineCapType.Square; 29 | PenAlign = PenAlignment.Center; 30 | HowLineJoin = LineJoin.Round; 31 | } 32 | 33 | public StrokableProperty Clone() 34 | { 35 | StrokableProperty sp = new StrokableProperty(); 36 | sp.Antialias = this.Antialias; 37 | sp.PenWidth = this.PenWidth; 38 | sp.StrokeColor = this.StrokeColor; 39 | sp.LineDash = this.LineDash; 40 | sp.StartLineCap = this.StartLineCap; 41 | sp.EndLineCap = this.EndLineCap; 42 | sp.PenAlign = this.PenAlign; 43 | sp.HowLineJoin = this.HowLineJoin; 44 | return sp; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/Shapes/structs/DraggableHotSpot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace Gdu.ExtendedPaint 5 | { 6 | /// 7 | /// 用于表示一个矩形区域,可以是可拖动的线段顶点,虚线选择框上面的小方块(拖动可对形状缩放), 8 | /// 以及一个旋转形状的区域 9 | /// 10 | public struct DraggableHotSpot 11 | { 12 | public Rectangle Rect; 13 | HotSpotType _type; 14 | public int AnchorAngle; 15 | public bool Visible; 16 | 17 | public DraggableHotSpot(HotSpotType type) 18 | { 19 | Rect = Rectangle.Empty; 20 | _type = type; 21 | AnchorAngle = 0; 22 | Visible = true; 23 | } 24 | 25 | public DraggableHotSpot(Rectangle rect, HotSpotType type) 26 | { 27 | Rect = rect; 28 | _type = type; 29 | AnchorAngle = 0; 30 | Visible = true; 31 | } 32 | 33 | public HotSpotType Type { get { return _type; } } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ExtendedPaint/ExtendedPaint/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /IPAddressBox/Actions-edit-rename-icon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/IPAddressBox/Actions-edit-rename-icon.bmp -------------------------------------------------------------------------------- /IPAddressBox/Actions-edit-rename-icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/IPAddressBox/Actions-edit-rename-icon.jpg -------------------------------------------------------------------------------- /IPAddressBox/IPAddressBox.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {25BB6334-AF46-4306-8C0E-A4C33B3D3BF2} 9 | Library 10 | Properties 11 | IPAddressBox 12 | IPAddressBox 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | connection.ico 43 | 44 | 45 | 46 | 47 | 48 | 49 | AnyCPU 50 | bin\Debug\ 51 | 52 | 53 | AnyCPU 54 | bin\Release\ 55 | false 56 | true 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Component 73 | 74 | 75 | 76 | 77 | 78 | 79 | IPAddressBoxs.cs 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 97 | -------------------------------------------------------------------------------- /IPAddressBox/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("IPAddressBox2")] 9 | [assembly: AssemblyDescription("IP Address Box")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("MEEDUN SOFT")] 12 | [assembly: AssemblyProduct("IPAddressBox2")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("UNDER NULLFX FREE SOFTWARE LICENSE")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("45086d52-c4f6-497f-8768-700c964282ec")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.2.0.0")] 36 | [assembly: AssemblyFileVersion("1.2.0.0")] 37 | -------------------------------------------------------------------------------- /IPAddressBox/Resources/Actions-edit-rename-icon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/IPAddressBox/Resources/Actions-edit-rename-icon.bmp -------------------------------------------------------------------------------- /IPAddressBox/Resources/CheckList.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/IPAddressBox/Resources/CheckList.ico -------------------------------------------------------------------------------- /IPAddressBox/Resources/Security-Warning-Shield-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/IPAddressBox/Resources/Security-Warning-Shield-icon.ico -------------------------------------------------------------------------------- /IPAddressBox/connection.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/IPAddressBox/connection.ico -------------------------------------------------------------------------------- /InfoSender.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextSender", "TextSender\TextSender.csproj", "{9291257B-DD0D-47E8-B552-51F95566C82D}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtendedPaint", "ExtendedPaint\ExtendedPaint\ExtendedPaint.csproj", "{57CDE75A-9496-4334-8F4B-ECE29DA316FD}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaterialSkin", "MaterialSkin\MaterialSkin.csproj", "{8EB7611B-68CD-4B8B-987A-11717E2B250C}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|x86 = Debug|x86 16 | Release|Any CPU = Release|Any CPU 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Debug|x86.ActiveCfg = Debug|Any CPU 23 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Debug|x86.Build.0 = Debug|Any CPU 24 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Release|x86.ActiveCfg = Release|Any CPU 27 | {9291257B-DD0D-47E8-B552-51F95566C82D}.Release|x86.Build.0 = Release|Any CPU 28 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Debug|x86.ActiveCfg = Debug|x86 31 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Debug|x86.Build.0 = Debug|x86 32 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Release|x86.ActiveCfg = Release|x86 35 | {57CDE75A-9496-4334-8F4B-ECE29DA316FD}.Release|x86.Build.0 = Release|x86 36 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Debug|x86.ActiveCfg = Debug|Any CPU 39 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Debug|x86.Build.0 = Debug|Any CPU 40 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Release|x86.ActiveCfg = Release|Any CPU 43 | {8EB7611B-68CD-4B8B-987A-11717E2B250C}.Release|x86.Build.0 = Release|Any CPU 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | EndGlobal 49 | -------------------------------------------------------------------------------- /MaterialSkin/Animations/AnimationDirection.cs: -------------------------------------------------------------------------------- 1 | namespace MaterialSkin.Animations 2 | { 3 | enum AnimationDirection 4 | { 5 | In, //In. Stops if finished. 6 | Out, //Out. Stops if finished. 7 | InOutIn, //Same as In, but changes to InOutOut if finished. 8 | InOutOut, //Same as Out. 9 | InOutRepeatingIn, // Same as In, but changes to InOutRepeatingOut if finished. 10 | InOutRepeatingOut // Same as Out, but changes to InOutRepeatingIn if finished. 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MaterialSkin/Animations/Animations.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MaterialSkin.Animations 4 | { 5 | enum AnimationType 6 | { 7 | Linear, 8 | EaseInOut, 9 | EaseOut, 10 | CustomQuadratic 11 | } 12 | 13 | static class AnimationLinear 14 | { 15 | public static double CalculateProgress(double progress) 16 | { 17 | return progress; 18 | } 19 | } 20 | 21 | static class AnimationEaseInOut 22 | { 23 | public static double PI = Math.PI; 24 | public static double PI_HALF = Math.PI / 2; 25 | 26 | public static double CalculateProgress(double progress) 27 | { 28 | return EaseInOut(progress); 29 | } 30 | 31 | private static double EaseInOut(double s) 32 | { 33 | return s - Math.Sin(s * 2 * PI) / (2 * PI); 34 | } 35 | } 36 | 37 | public static class AnimationEaseOut 38 | { 39 | public static double CalculateProgress(double progress) 40 | { 41 | return -1 * progress * (progress - 2); 42 | } 43 | } 44 | 45 | public static class AnimationCustomQuadratic 46 | { 47 | public static double CalculateProgress(double progress) 48 | { 49 | double kickoff = 0.6; 50 | return 1 - Math.Cos((Math.Max(progress, kickoff) - kickoff) * Math.PI / (2 - (2 * kickoff))); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /MaterialSkin/Controls/MaterialDivider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace MaterialSkin.Controls 5 | { 6 | public sealed class MaterialDivider : Control, IMaterialControl 7 | { 8 | [Browsable(false)] 9 | public int Depth { get; set; } 10 | [Browsable(false)] 11 | public MaterialSkinManager SkinManager { get { return MaterialSkinManager.Instance; } } 12 | [Browsable(false)] 13 | public MouseState MouseState { get; set; } 14 | 15 | public MaterialDivider() 16 | { 17 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 18 | Height = 1; 19 | BackColor = SkinManager.GetDividersColor(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MaterialSkin/Controls/MaterialLabel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace MaterialSkin.Controls 5 | { 6 | public class MaterialLabel : Label, IMaterialControl 7 | { 8 | [Browsable(false)] 9 | public int Depth { get; set; } 10 | [Browsable(false)] 11 | public MaterialSkinManager SkinManager { get { return MaterialSkinManager.Instance; } } 12 | [Browsable(false)] 13 | public MouseState MouseState { get; set; } 14 | protected override void OnCreateControl() 15 | { 16 | base.OnCreateControl(); 17 | 18 | ForeColor = SkinManager.GetPrimaryTextColor(); 19 | Font = SkinManager.ROBOTO_REGULAR_11; 20 | 21 | BackColorChanged += (sender, args) => ForeColor = SkinManager.GetPrimaryTextColor(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MaterialSkin/Controls/MaterialProgressBar.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace MaterialSkin.Controls 5 | { 6 | /// 7 | /// Material design-like progress bar 8 | /// 9 | public class MaterialProgressBar : ProgressBar, IMaterialControl 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | public MaterialProgressBar() 15 | { 16 | SetStyle(ControlStyles.UserPaint, true); 17 | SetStyle(ControlStyles.OptimizedDoubleBuffer, true); 18 | } 19 | 20 | /// 21 | /// Gets or sets the depth. 22 | /// 23 | /// 24 | /// The depth. 25 | /// 26 | [Browsable(false)] 27 | public int Depth { get; set; } 28 | 29 | /// 30 | /// Gets the skin manager. 31 | /// 32 | /// 33 | /// The skin manager. 34 | /// 35 | [Browsable(false)] 36 | public MaterialSkinManager SkinManager 37 | { 38 | get { return MaterialSkinManager.Instance; } 39 | } 40 | 41 | /// 42 | /// Gets or sets the state of the mouse. 43 | /// 44 | /// 45 | /// The state of the mouse. 46 | /// 47 | [Browsable(false)] 48 | public MouseState MouseState { get; set; } 49 | 50 | /// 51 | /// Performs the work of setting the specified bounds of this control. 52 | /// 53 | /// The new property value of the control. 54 | /// The new property value of the control. 55 | /// The new property value of the control. 56 | /// The new property value of the control. 57 | /// A bitwise combination of the values. 58 | protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) 59 | { 60 | base.SetBoundsCore(x, y, width, 5, specified); 61 | } 62 | 63 | /// 64 | /// Raises the event. 65 | /// 66 | /// A that contains the event data. 67 | protected override void OnPaint(PaintEventArgs e) 68 | { 69 | var doneProgress = (int)(e.ClipRectangle.Width * ((double)Value / Maximum)); 70 | e.Graphics.FillRectangle(SkinManager.ColorScheme.PrimaryBrush, 0, 0, doneProgress, e.ClipRectangle.Height); 71 | e.Graphics.FillRectangle(SkinManager.GetDisabledOrHintBrush(), doneProgress, 0, e.ClipRectangle.Width, e.ClipRectangle.Height); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /MaterialSkin/Controls/MaterialRaisedButton.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | using System.Drawing.Text; 5 | using System.Windows.Forms; 6 | using MaterialSkin.Animations; 7 | 8 | namespace MaterialSkin.Controls 9 | { 10 | public class MaterialRaisedButton : Button, IMaterialControl 11 | { 12 | [Browsable(false)] 13 | public int Depth { get; set; } 14 | [Browsable(false)] 15 | public MaterialSkinManager SkinManager { get { return MaterialSkinManager.Instance; } } 16 | [Browsable(false)] 17 | public MouseState MouseState { get; set; } 18 | public bool Primary { get; set; } 19 | 20 | private readonly AnimationManager animationManager; 21 | 22 | public MaterialRaisedButton() 23 | { 24 | Primary = true; 25 | 26 | animationManager = new AnimationManager(false) 27 | { 28 | Increment = 0.03, 29 | AnimationType = AnimationType.EaseOut 30 | }; 31 | animationManager.OnAnimationProgress += sender => Invalidate(); 32 | } 33 | 34 | protected override void OnMouseUp(MouseEventArgs mevent) 35 | { 36 | base.OnMouseUp(mevent); 37 | 38 | animationManager.StartNewAnimation(AnimationDirection.In, mevent.Location); 39 | } 40 | 41 | protected override void OnPaint(PaintEventArgs pevent) 42 | { 43 | var g = pevent.Graphics; 44 | g.SmoothingMode = SmoothingMode.AntiAlias; 45 | g.TextRenderingHint = TextRenderingHint.AntiAlias; 46 | 47 | g.Clear(Parent.BackColor); 48 | 49 | using (var backgroundPath = DrawHelper.CreateRoundRect(ClientRectangle.X, 50 | ClientRectangle.Y, 51 | ClientRectangle.Width - 1, 52 | ClientRectangle.Height - 1, 53 | 1f)) 54 | { 55 | if (Enabled) 56 | { 57 | g.FillPath(Primary ? SkinManager.ColorScheme.PrimaryBrush : SkinManager.GetRaisedButtonBackgroundBrush(), backgroundPath); 58 | } 59 | else 60 | { 61 | g.FillPath( SkinManager.GetCheckBoxOffDisabledBrush(), backgroundPath); 62 | } 63 | } 64 | 65 | if (animationManager.IsAnimating()) 66 | { 67 | for (int i = 0; i < animationManager.GetAnimationCount(); i++) 68 | { 69 | var animationValue = animationManager.GetProgress(i); 70 | var animationSource = animationManager.GetSource(i); 71 | var rippleBrush = new SolidBrush(Color.FromArgb((int)(51 - (animationValue * 50)), Color.White)); 72 | var rippleSize = (int)(animationValue * Width * 2); 73 | g.FillEllipse(rippleBrush, new Rectangle(animationSource.X - rippleSize / 2, animationSource.Y - rippleSize / 2, rippleSize, rippleSize)); 74 | } 75 | } 76 | 77 | g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; 78 | g.DrawString( 79 | Text, //Text.ToUpper(), 80 | SkinManager.ROBOTO_MEDIUM_10, 81 | SkinManager.GetRaisedButtonTextBrush(Primary), 82 | ClientRectangle, 83 | new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /MaterialSkin/Controls/MaterialTabControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows.Forms; 4 | 5 | namespace MaterialSkin.Controls 6 | { 7 | public class MaterialTabControl : TabControl, IMaterialControl 8 | { 9 | [Browsable(false)] 10 | public int Depth { get; set; } 11 | [Browsable(false)] 12 | public MaterialSkinManager SkinManager { get { return MaterialSkinManager.Instance; } } 13 | [Browsable(false)] 14 | public MouseState MouseState { get; set; } 15 | 16 | protected override void WndProc(ref Message m) 17 | { 18 | if (m.Msg == 0x1328 && !DesignMode) m.Result = (IntPtr)1; 19 | else base.WndProc(ref m); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MaterialSkin/DrawHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Drawing.Drawing2D; 3 | 4 | namespace MaterialSkin 5 | { 6 | static class DrawHelper 7 | { 8 | public static GraphicsPath CreateRoundRect(float x, float y, float width, float height, float radius) 9 | { 10 | GraphicsPath gp = new GraphicsPath(); 11 | gp.AddLine(x + radius, y, x + width - (radius * 2), y); 12 | gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90); 13 | gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2)); 14 | gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90); 15 | gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height); 16 | gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90); 17 | gp.AddLine(x, y + height - (radius * 2), x, y + radius); 18 | gp.AddArc(x, y, radius * 2, radius * 2, 180, 90); 19 | gp.CloseFigure(); 20 | return gp; 21 | } 22 | 23 | public static GraphicsPath CreateRoundRect(Rectangle rect, float radius) 24 | { 25 | return CreateRoundRect(rect.X, rect.Y, rect.Width, rect.Height, radius); 26 | } 27 | 28 | public static Color BlendColor(Color backgroundColor, Color frontColor, double blend) 29 | { 30 | double ratio = blend / 255d; 31 | double invRatio = 1d - ratio; 32 | int r = (int)((backgroundColor.R * invRatio) + (frontColor.R * ratio)); 33 | int g = (int)((backgroundColor.G * invRatio) + (frontColor.G * ratio)); 34 | int b = (int)((backgroundColor.B * invRatio) + (frontColor.B * ratio)); 35 | return Color.FromArgb(r, g, b); 36 | } 37 | 38 | public static Color BlendColor(Color backgroundColor, Color frontColor) 39 | { 40 | return BlendColor(backgroundColor, frontColor, frontColor.A); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /MaterialSkin/IMaterialControl.cs: -------------------------------------------------------------------------------- 1 | namespace MaterialSkin 2 | { 3 | interface IMaterialControl 4 | { 5 | int Depth { get; set; } 6 | MaterialSkinManager SkinManager { get; } 7 | MouseState MouseState { get; set; } 8 | 9 | } 10 | 11 | public enum MouseState 12 | { 13 | HOVER, 14 | DOWN, 15 | OUT 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MaterialSkin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("MaterialSkin")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("MaterialSkin")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("52781de3-a323-49ee-9a4f-c67280f8d328")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MaterialSkin/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MaterialSkin.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MaterialSkin.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 数字标牌(广告机) 电脑发布端 2 | 能播放包含视频、图片、字幕等多媒体节目的App, 适配安卓大屏终端, 提供完全开源的配套信息发布软件. 3 | 适应餐饮、零售等行业单机或局域网内应用 4 | 5 | [ 配套安卓播放端 ](https://github.com/xfirefly/AD_Client) 6 | 7 | ## 术语解释 8 | - 终端: 播放多媒体广告内容的硬件设备 9 | - 场景: 记录了媒体文件播放顺序和在屏幕中播放的位置, 也可以设定时间定时播放 10 | - 节目单: 由一个或多个场景组成, 每个场景可单独定时播放或所有场景轮流播 11 | 12 | ## 安卓播放端功能 13 | - 支持播放avi,mkv,mp4,jpg,png,bmp 等文件 14 | - 支持音量设置,截图等 15 | - 支持播放文件数据校验 16 | - 支持后台下载播放内容 17 | - 支持多场景轮流播放 18 | - 支持场景定时播放 19 | - 支持网络更新和U盘更新节目 20 | - 支持HDMI IN, 也就是HDMI输入功能, 同时显示广告和一个外接HDMI信号源(Realtek芯片支持) 21 | 22 | ## 信息发布软件功能 23 | - 所见即所得的节目制作界面 24 | - 内置行业模版 25 | - 支持中文/英语 26 | - 支持局域网或者广域网的服务器 27 | - 支持终端设备截屏 28 | - 支持即时显示当前设备在线量 29 | - 局域网自动发现终端 30 | - 字幕组件支持调整文字颜色,背景色,字体,滚动速度等属性 31 | - 视频组件支持多视频轮播,定时播 32 | 33 | ## TODO 34 | - 时间, 天气, 日历, 金融股票等动态数据组件 35 | - 表格组件, 需对接第三方数据源, 比如数据从mysql 获取 36 | - 横/竖屏广告机需求 37 | - 多视频支持(单场景) 38 | 39 | ## 问题反馈 40 | - issue please 41 | - 微信 maxfirefly 42 | 43 | ## 注意 44 | - 仅供学习, 不可商用 -------------------------------------------------------------------------------- /TextSender/AdZip.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using Newtonsoft.Json; 3 | using ProgressTest; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.ComponentModel; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Net; 10 | using System.Net.Sockets; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | using System.Windows.Forms; 14 | using TextSender; 15 | 16 | namespace Common 17 | { 18 | public class AdZip 19 | { 20 | private Log log; 21 | private Ionic.Zip.ZipFile zip; 22 | 23 | // =========== Singleton ============== 24 | private static readonly Lazy lazy = new Lazy(() => new AdZip()); 25 | public static AdZip Instance { get { return lazy.Value; } } 26 | 27 | private AdZip() 28 | { 29 | log = new Log(GetType()); 30 | } 31 | // =========== Singleton ============== 32 | 33 | public void init() 34 | { 35 | zip = new Ionic.Zip.ZipFile(); 36 | zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None; 37 | zip.StatusMessageTextWriter = System.Console.Out; 38 | } 39 | 40 | public void add(string path) 41 | { 42 | try 43 | { 44 | zip.AddFile(path, ""); 45 | } 46 | catch (Exception ex) 47 | { 48 | log.e("zip error " + ex.Message); 49 | } 50 | } 51 | 52 | public void save(string zipfile) 53 | { 54 | //string zipfile = App.ZipPath; 55 | File.Delete(zipfile); 56 | zip.Save(zipfile); 57 | 58 | zip.Dispose(); 59 | } 60 | 61 | private string CreateAdZip() 62 | { 63 | string zipfile = App.ZipPath; 64 | File.Delete(zipfile); 65 | using (var zip = new Ionic.Zip.ZipFile()) 66 | { 67 | zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None; 68 | //zip.SaveProgress += SaveProgress; 69 | 70 | zip.StatusMessageTextWriter = System.Console.Out; 71 | zip.AddDirectory(App.TmpDir, ""); 72 | zip.Save(zipfile); 73 | } 74 | 75 | return zipfile; 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /TextSender/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /TextSender/Box.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using ControlManager; 3 | using Ctrl; 4 | using Net; 5 | using System; 6 | using System.Collections; 7 | using System.Collections.Generic; 8 | using System.ComponentModel; 9 | using System.Data; 10 | using System.Drawing; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | using System.Windows.Forms; 15 | 16 | namespace TextSender 17 | { 18 | 19 | public class Box 20 | { 21 | public string ip; 22 | public string name; 23 | public string id; 24 | 25 | public CommandChannel CmdChan; 26 | 27 | 28 | public override string ToString() 29 | { 30 | //string txt = string.Format("{0} [{1}] [{2}]", name, id, ip); 31 | return string.Format("{0} [{1}]", name, ip); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /TextSender/ExportPro.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Net.Sockets; 4 | using System.Text; 5 | using System.Threading; 6 | 7 | namespace RS232 8 | { 9 | class sss 10 | { 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /TextSender/FFMPEG.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using System; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Text.RegularExpressions; 6 | using TextSender; 7 | 8 | public class FFMPEG 9 | { 10 | private static Process ffmpeg; 11 | 12 | public static void exec(string input, string output, string parametri) 13 | { 14 | ffmpeg = new Process(); 15 | 16 | ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -y -ss 00:00:02 -vframes 1 -an " + parametri + output; 17 | ffmpeg.StartInfo.FileName = "ffmpeg.exe"; 18 | ffmpeg.StartInfo.UseShellExecute = false; 19 | ffmpeg.StartInfo.RedirectStandardOutput = true; 20 | ffmpeg.StartInfo.RedirectStandardError = true; 21 | ffmpeg.StartInfo.CreateNoWindow = true; 22 | 23 | Console.WriteLine(ffmpeg.StartInfo.Arguments); 24 | ffmpeg.Start(); 25 | ffmpeg.WaitForExit(); 26 | ffmpeg.Close(); 27 | } 28 | 29 | public static void GetThumbnail(string video, string jpg, string velicina) 30 | { 31 | if (velicina == null) 32 | velicina = "640*480 "; 33 | 34 | exec(video, jpg, "-s " + velicina); 35 | } 36 | 37 | public static string GetThumbnail(string video) 38 | { 39 | Directory.CreateDirectory(App.ScrshotDir); 40 | 41 | string imgPath; 42 | 43 | //重新打开场景, 视频缩略图已经生成了 44 | if (video.Contains(frmMain.VideoPrefix)) 45 | { 46 | Regex reg = new Regex(@"advid_(.*)\."); 47 | var mat = reg.Match(video); 48 | Console.WriteLine(mat.Groups[1]); 49 | 50 | imgPath = Path.Combine(App.ScrshotDir, mat.Groups[1] + ".png"); 51 | 52 | } 53 | else 54 | { 55 | imgPath = Path.Combine(App.ScrshotDir, Util.md5(video) + ".png"); 56 | } 57 | 58 | if (!File.Exists(imgPath)) 59 | { 60 | exec(video, imgPath, "-s 960*540 "); 61 | } 62 | 63 | if( !File.Exists(imgPath)) 64 | { 65 | imgPath = Path.Combine(App.Dir, "screen_def.png"); 66 | } 67 | 68 | return imgPath; 69 | } 70 | } -------------------------------------------------------------------------------- /TextSender/IAdUserControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace TextSender 7 | { 8 | 9 | interface IAdUserControl 10 | { 11 | void OnActivate(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TextSender/InputText.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace TextSender 2 | { 3 | partial class frmInputText 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmInputText)); 32 | this.groupBoxEx1 = new Ctrl.GroupBoxEx(); 33 | this.button1 = new System.Windows.Forms.Button(); 34 | this.textBox1 = new System.Windows.Forms.TextBox(); 35 | this.groupBoxEx1.SuspendLayout(); 36 | this.SuspendLayout(); 37 | // 38 | // groupBoxEx1 39 | // 40 | resources.ApplyResources(this.groupBoxEx1, "groupBoxEx1"); 41 | this.groupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(23)))), ((int)(((byte)(169)))), ((int)(((byte)(254))))); 42 | this.groupBoxEx1.Controls.Add(this.button1); 43 | this.groupBoxEx1.Controls.Add(this.textBox1); 44 | this.groupBoxEx1.Name = "groupBoxEx1"; 45 | this.groupBoxEx1.TabStop = false; 46 | // 47 | // button1 48 | // 49 | resources.ApplyResources(this.button1, "button1"); 50 | this.button1.Name = "button1"; 51 | this.button1.UseVisualStyleBackColor = true; 52 | this.button1.Click += new System.EventHandler(this.button1_Click); 53 | // 54 | // textBox1 55 | // 56 | resources.ApplyResources(this.textBox1, "textBox1"); 57 | this.textBox1.Name = "textBox1"; 58 | this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); 59 | // 60 | // frmInputText 61 | // 62 | resources.ApplyResources(this, "$this"); 63 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 64 | this.Controls.Add(this.groupBoxEx1); 65 | this.Name = "frmInputText"; 66 | this.Load += new System.EventHandler(this.InputText_Load); 67 | this.groupBoxEx1.ResumeLayout(false); 68 | this.groupBoxEx1.PerformLayout(); 69 | this.ResumeLayout(false); 70 | 71 | } 72 | 73 | #endregion 74 | 75 | private Ctrl.GroupBoxEx groupBoxEx1; 76 | private System.Windows.Forms.Button button1; 77 | private System.Windows.Forms.TextBox textBox1; 78 | } 79 | } -------------------------------------------------------------------------------- /TextSender/InputText.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace TextSender 11 | { 12 | public partial class frmInputText : Form 13 | { 14 | public frmInputText() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | public frmInputText(string txt) 20 | : this() 21 | { 22 | textBox1.Text = txt; 23 | } 24 | 25 | private void InputText_Load(object sender, EventArgs e) 26 | { 27 | 28 | } 29 | 30 | private void button1_Click(object sender, EventArgs e) 31 | { 32 | this.Close(); 33 | } 34 | 35 | // 声明和定义委托 36 | public delegate void TxtChangedHandler(string title); 37 | public TxtChangedHandler TxtChanged; 38 | 39 | private void textBox1_TextChanged(object sender, EventArgs e) 40 | { 41 | if (TxtChanged != null) 42 | TxtChanged(textBox1.Text); //委托调用 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /TextSender/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 6 | 7 | 8 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /TextSender/NetUtils.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Net.Sockets; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Common 11 | { 12 | internal class NetUtils 13 | { 14 | private static Log log = new Log("NetUtils"); 15 | 16 | private UdpClient _listener = null; 17 | 18 | public NetUtils() 19 | { 20 | } 21 | 22 | public static void broadcast(byte[] msg) 23 | { 24 | Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 25 | s.EnableBroadcast = true; 26 | s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true); 27 | IPEndPoint ep = new IPEndPoint(IPAddress.Broadcast, Cmd.broadcast_port); 28 | 29 | //IPAddress broadcast = IPAddress.Parse("192.168.1.255"); 30 | s.SendTo(msg, ep); 31 | } 32 | 33 | public static string GetLocalIPAddress() 34 | { 35 | var host = Dns.GetHostEntry(Dns.GetHostName()); 36 | foreach (var ip in host.AddressList) 37 | { 38 | if (ip.AddressFamily == AddressFamily.InterNetwork) 39 | { 40 | return ip.ToString(); 41 | } 42 | } 43 | throw new Exception("Local IP Address Not Found!"); 44 | } 45 | 46 | public void startRecv() 47 | { 48 | _listener = new UdpClient(Cmd.broadcast_port); 49 | _listener.BeginReceive(new AsyncCallback(recvMsg), null); 50 | } 51 | 52 | public void stop() 53 | { 54 | if (_listener != null) 55 | _listener.Close(); 56 | } 57 | 58 | private void recvMsg(IAsyncResult res) 59 | { 60 | IPEndPoint remote = new IPEndPoint(IPAddress.Any, Cmd.broadcast_port); 61 | 62 | try 63 | { 64 | // byte[] bytes = listener.Receive(ref remote); 65 | byte[] bytes = _listener.EndReceive(res, ref remote); 66 | 67 | log.i(String.Format("recv broadcast from {0} :\n {1}\n", 68 | remote.ToString(), 69 | Encoding.ASCII.GetString(bytes, 0, bytes.Length))); 70 | 71 | // get next packet 72 | _listener.BeginReceive(recvMsg, null); 73 | } 74 | catch (Exception ex) 75 | { 76 | log.e(ex.ToString()); 77 | } 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /TextSender/Program.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using Net; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Diagnostics; 6 | using System.Linq; 7 | using System.Runtime.InteropServices; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace TextSender 13 | { 14 | public static class Program 15 | { 16 | /// 17 | /// 应用程序的主入口点。 18 | /// 19 | [STAThread] 20 | static void Main() 21 | { 22 | bool runone; 23 | System.Threading.Mutex run = new System.Threading.Mutex(true, "run_once_bb", out runone); 24 | if (runone) 25 | { /* 26 | try 27 | { 28 | //设置应用程序处理异常方式:ThreadException处理 29 | Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); 30 | //处理UI线程异常 31 | Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); 32 | //处理非UI线程异常 33 | AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 34 | 35 | App.Instance.init(); 36 | #region 应用程序的主入口点 37 | Application.EnableVisualStyles(); 38 | Application.SetCompatibleTextRenderingDefault(false); 39 | Application.Run(new frmMain()); 40 | #endregion 41 | App.Instance.unInit(); 42 | } 43 | catch (Exception ex) 44 | { 45 | string str = GetExceptionMsg(ex, string.Empty); 46 | MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); 47 | } */ 48 | #region 应用程序的主入口点 49 | App.Instance.init(); 50 | 51 | Application.EnableVisualStyles(); 52 | Application.SetCompatibleTextRenderingDefault(false); 53 | Application.Run(new frmHome()); 54 | 55 | App.Instance.unInit(); 56 | #endregion 57 | } 58 | else 59 | { 60 | App.MsgBox("上次运行的程序正在退出, 请稍候重启。" ); 61 | //App.restart(); 62 | } 63 | } 64 | 65 | static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) 66 | { 67 | string str = GetExceptionMsg(e.Exception, e.ToString()); 68 | MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); 69 | //LogManager.WriteLog(str); 70 | } 71 | 72 | static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) 73 | { 74 | string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString()); 75 | MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); 76 | //LogManager.WriteLog(str); 77 | } 78 | 79 | /// 80 | /// 生成自定义异常消息 81 | /// 82 | /// 异常对象 83 | /// 备用异常消息:当ex为null时有效 84 | /// 异常字符串文本 85 | static string GetExceptionMsg(Exception ex, string backStr) 86 | { 87 | System.Text.StringBuilder sb = new System.Text.StringBuilder(); 88 | sb.AppendLine("****************************异常文本****************************"); 89 | sb.AppendLine("【出现时间】:" + DateTime.Now.ToString()); 90 | if (ex != null) 91 | { 92 | sb.AppendLine("【异常类型】:" + ex.GetType().Name); 93 | sb.AppendLine("【异常信息】:" + ex.Message); 94 | sb.AppendLine("【堆栈调用】:" + ex.StackTrace); 95 | } 96 | else 97 | { 98 | sb.AppendLine("【未处理异常】:" + backStr); 99 | } 100 | sb.AppendLine("***************************************************************"); 101 | return sb.ToString(); 102 | } 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /TextSender/ProgressForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ProgressTest 2 | { 3 | partial class ProgressForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProgressForm)); 32 | this.labelStatus = new System.Windows.Forms.Label(); 33 | this.progressBar = new System.Windows.Forms.ProgressBar(); 34 | this.buttonCancel = new System.Windows.Forms.Button(); 35 | this.SuspendLayout(); 36 | // 37 | // labelStatus 38 | // 39 | resources.ApplyResources(this.labelStatus, "labelStatus"); 40 | this.labelStatus.Name = "labelStatus"; 41 | // 42 | // progressBar 43 | // 44 | resources.ApplyResources(this.progressBar, "progressBar"); 45 | this.progressBar.Name = "progressBar"; 46 | this.progressBar.Click += new System.EventHandler(this.progressBar_Click); 47 | // 48 | // buttonCancel 49 | // 50 | resources.ApplyResources(this.buttonCancel, "buttonCancel"); 51 | this.buttonCancel.Name = "buttonCancel"; 52 | this.buttonCancel.UseVisualStyleBackColor = true; 53 | this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); 54 | // 55 | // ProgressForm 56 | // 57 | resources.ApplyResources(this, "$this"); 58 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 59 | this.ControlBox = false; 60 | this.Controls.Add(this.buttonCancel); 61 | this.Controls.Add(this.progressBar); 62 | this.Controls.Add(this.labelStatus); 63 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 64 | this.Name = "ProgressForm"; 65 | this.ShowIcon = false; 66 | this.ShowInTaskbar = false; 67 | this.Load += new System.EventHandler(this.ProgressForm_Load); 68 | this.ResumeLayout(false); 69 | this.PerformLayout(); 70 | 71 | } 72 | 73 | #endregion 74 | 75 | private System.Windows.Forms.Label labelStatus; 76 | private System.Windows.Forms.ProgressBar progressBar; 77 | private System.Windows.Forms.Button buttonCancel; 78 | } 79 | } -------------------------------------------------------------------------------- /TextSender/ProgressForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace ProgressTest 5 | { 6 | /// 7 | /// Simple progress form. 8 | /// 9 | public partial class ProgressForm : Form 10 | { 11 | //BackgroundWorker worker; 12 | private int lastPercent; 13 | 14 | private string lastStatus; 15 | 16 | /// 17 | /// Constructor. 18 | /// 19 | public ProgressForm() 20 | { 21 | InitializeComponent(); 22 | 23 | DefaultStatusText = "Please wait..."; 24 | CancellingText = "Cancelling operation..."; 25 | progressBar.Minimum = progressBar.Value = 0; 26 | 27 | //worker = new BackgroundWorker(); 28 | //worker.WorkerReportsProgress = true; 29 | //worker.WorkerSupportsCancellation = true; 30 | //worker.DoWork += new System.ComponentModel.DoWorkEventHandler(worker_DoWork); 31 | //worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged); 32 | //worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); 33 | } 34 | 35 | public ProgressForm(int max) 36 | : this() 37 | { 38 | progressBar.Maximum = max; 39 | } 40 | 41 | /// 42 | /// Text displayed once the Cancel button is clicked. 43 | /// 44 | public string CancellingText { get; set; } 45 | 46 | /// 47 | /// Default status text. 48 | /// 49 | public string DefaultStatusText { get; set; } 50 | 51 | /// 52 | /// Gets the progress bar so it is possible to customize it 53 | /// before displaying the form. 54 | /// Do not use it directly from the background worker function! 55 | /// 56 | public ProgressBar ProgressBar { get { return progressBar; } } 57 | /// 58 | /// Changes the progress bar value only. 59 | /// 60 | /// New value for the progress bar. 61 | public void SetProgress(int percent) 62 | { 63 | //do not update the progress bar if the value didn't change 64 | if (percent != lastPercent) 65 | { 66 | lastPercent = percent; 67 | progressBar.Value = percent; 68 | //worker.ReportProgress(percent); 69 | } 70 | 71 | Console.WriteLine("SetProgress " + progressBar.Value + " " + progressBar.Maximum); 72 | if (progressBar.Value == progressBar.Maximum) 73 | { 74 | this.DialogResult = DialogResult.OK; 75 | Close(); 76 | } 77 | } 78 | 79 | private void buttonCancel_Click(object sender, EventArgs e) 80 | { 81 | //notify the background worker we want to cancel 82 | //worker.CancelAsync(); 83 | //disable the cancel button and change the status text 84 | buttonCancel.Enabled = false; 85 | labelStatus.Text = CancellingText; 86 | Close(); 87 | } 88 | 89 | private void progressBar_Click(object sender, EventArgs e) 90 | { 91 | } 92 | 93 | private void ProgressForm_Load(object sender, EventArgs e) 94 | { 95 | //reset to defaults just in case the user wants to reuse the form 96 | buttonCancel.Enabled = true; 97 | progressBar.Value = progressBar.Minimum; 98 | labelStatus.Text = DefaultStatusText; 99 | lastStatus = DefaultStatusText; 100 | lastPercent = progressBar.Minimum; 101 | //start the background worker as soon as the form is loaded 102 | //worker.RunWorkerAsync(Argument); 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /TextSender/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("TextSender")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("TextSender")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9291257b-dd0d-47e8-b552-51f95566c82d")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TextSender/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TextSender.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TextSender/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TextSender/Resource1.en.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resource1.en.Designer.cs -------------------------------------------------------------------------------- /TextSender/Resources/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/1.png -------------------------------------------------------------------------------- /TextSender/Resources/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/16.png -------------------------------------------------------------------------------- /TextSender/Resources/Actions-go-next-view-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Actions-go-next-view-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Actions-go-previous-view-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Actions-go-previous-view-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Actions-insert-text-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Actions-insert-text-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Clock-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Clock-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Cursor-Move-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Cursor-Move-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Editing-Bold-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Editing-Bold-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Editing-Italic-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Editing-Italic-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Editing-Underline-icon (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Editing-Underline-icon (1).png -------------------------------------------------------------------------------- /TextSender/Resources/Editing-Underline-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Editing-Underline-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Editing-Underline-icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Editing-Underline-icon1.png -------------------------------------------------------------------------------- /TextSender/Resources/File-Video-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/File-Video-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Files-New-File-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Files-New-File-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/ID-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/ID-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Images-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Images-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Images-icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Images-icon1.png -------------------------------------------------------------------------------- /TextSender/Resources/Link-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Link-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Modify-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Modify-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Pictures-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Pictures-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Rename-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Rename-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Status-audio-volume-high-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Status-audio-volume-high-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Text-bold-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Text-bold-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/Text-itailc-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/Text-itailc-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/anti_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/anti_false.png -------------------------------------------------------------------------------- /TextSender/Resources/anti_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/anti_true.png -------------------------------------------------------------------------------- /TextSender/Resources/arrow-left-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/arrow-left-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/arrow-right-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/arrow-right-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_circle_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_circle_left.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_circle_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_circle_right.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_rect_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_rect_left.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_rect_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_rect_right.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_round_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_round_left.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_round_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_round_right.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_square_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_square_left.png -------------------------------------------------------------------------------- /TextSender/Resources/cap_square_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/cap_square_right.png -------------------------------------------------------------------------------- /TextSender/Resources/copy-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/copy-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/dash-dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/dash-dot.png -------------------------------------------------------------------------------- /TextSender/Resources/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/dash.png -------------------------------------------------------------------------------- /TextSender/Resources/dash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/dash2.png -------------------------------------------------------------------------------- /TextSender/Resources/dash_dot_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/dash_dot_dot.png -------------------------------------------------------------------------------- /TextSender/Resources/delete-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/delete-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/delete-icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/delete-icon1.png -------------------------------------------------------------------------------- /TextSender/Resources/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/dot.png -------------------------------------------------------------------------------- /TextSender/Resources/fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/fill.png -------------------------------------------------------------------------------- /TextSender/Resources/film-add-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/film-add-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/full-screen-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/full-screen-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/hexagon-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/hexagon-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/icon175x175.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/icon175x175.png -------------------------------------------------------------------------------- /TextSender/Resources/image-add-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/image-add-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/line_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/line_arrow_left.png -------------------------------------------------------------------------------- /TextSender/Resources/line_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/line_arrow_right.png -------------------------------------------------------------------------------- /TextSender/Resources/move-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/move-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/normal_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/normal_arrow_left.png -------------------------------------------------------------------------------- /TextSender/Resources/normal_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/normal_arrow_right.png -------------------------------------------------------------------------------- /TextSender/Resources/pan.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/pan.cur -------------------------------------------------------------------------------- /TextSender/Resources/photos-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/photos-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/q (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/q (1).png -------------------------------------------------------------------------------- /TextSender/Resources/q (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/q (2).png -------------------------------------------------------------------------------- /TextSender/Resources/q (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/q (3).png -------------------------------------------------------------------------------- /TextSender/Resources/rotate.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/rotate.cur -------------------------------------------------------------------------------- /TextSender/Resources/rr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/rr.png -------------------------------------------------------------------------------- /TextSender/Resources/select.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/select.cur -------------------------------------------------------------------------------- /TextSender/Resources/select2.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/select2.cur -------------------------------------------------------------------------------- /TextSender/Resources/seo-chain-link-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/seo-chain-link-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/shape-move-back-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/shape-move-back-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/sharp_arrow2_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/sharp_arrow2_left.png -------------------------------------------------------------------------------- /TextSender/Resources/sharp_arrow2_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/sharp_arrow2_right.png -------------------------------------------------------------------------------- /TextSender/Resources/sharp_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/sharp_arrow_left.png -------------------------------------------------------------------------------- /TextSender/Resources/sharp_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/sharp_arrow_right.png -------------------------------------------------------------------------------- /TextSender/Resources/sign-left-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/sign-left-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/sign-right-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/sign-right-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/size_0.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/size_0.cur -------------------------------------------------------------------------------- /TextSender/Resources/size_90.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/size_90.cur -------------------------------------------------------------------------------- /TextSender/Resources/solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/solid.png -------------------------------------------------------------------------------- /TextSender/Resources/symbol-check-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/symbol-check-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/symbol-delete-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/symbol-delete-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/text-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/text-icon.png -------------------------------------------------------------------------------- /TextSender/Resources/text-icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/text-icon1.png -------------------------------------------------------------------------------- /TextSender/Resources/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/text.png -------------------------------------------------------------------------------- /TextSender/Resources/tool_ellipse.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/tool_ellipse.cur -------------------------------------------------------------------------------- /TextSender/Resources/tool_line.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/tool_line.cur -------------------------------------------------------------------------------- /TextSender/Resources/tool_rect.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/tool_rect.cur -------------------------------------------------------------------------------- /TextSender/Resources/video-camera-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfirefly/AD_server/a498e6246908d7719d657751d0d31a3cedddca8a/TextSender/Resources/video-camera-icon.png -------------------------------------------------------------------------------- /TextSender/SetSceneTiming.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace TextSender 2 | { 3 | partial class SetSceneTiming 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region 组件设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetSceneTiming)); 32 | this.name = new System.Windows.Forms.Label(); 33 | this.timing = new System.Windows.Forms.Label(); 34 | this.materialDivider1 = new MaterialSkin.Controls.MaterialDivider(); 35 | this.setup = new MaterialSkin.Controls.MaterialRaisedButton(); 36 | this.SuspendLayout(); 37 | // 38 | // name 39 | // 40 | resources.ApplyResources(this.name, "name"); 41 | this.name.Name = "name"; 42 | // 43 | // timing 44 | // 45 | resources.ApplyResources(this.timing, "timing"); 46 | this.timing.Name = "timing"; 47 | // 48 | // materialDivider1 49 | // 50 | resources.ApplyResources(this.materialDivider1, "materialDivider1"); 51 | this.materialDivider1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); 52 | this.materialDivider1.Depth = 0; 53 | this.materialDivider1.MouseState = MaterialSkin.MouseState.HOVER; 54 | this.materialDivider1.Name = "materialDivider1"; 55 | // 56 | // setup 57 | // 58 | resources.ApplyResources(this.setup, "setup"); 59 | this.setup.Depth = 0; 60 | this.setup.MouseState = MaterialSkin.MouseState.HOVER; 61 | this.setup.Name = "setup"; 62 | this.setup.Primary = true; 63 | this.setup.UseVisualStyleBackColor = true; 64 | this.setup.Click += new System.EventHandler(this.setup_Click); 65 | // 66 | // SetSceneTiming 67 | // 68 | resources.ApplyResources(this, "$this"); 69 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 70 | this.Controls.Add(this.materialDivider1); 71 | this.Controls.Add(this.setup); 72 | this.Controls.Add(this.timing); 73 | this.Controls.Add(this.name); 74 | this.Name = "SetSceneTiming"; 75 | this.ResumeLayout(false); 76 | this.PerformLayout(); 77 | 78 | } 79 | 80 | #endregion 81 | 82 | private System.Windows.Forms.Label name; 83 | private System.Windows.Forms.Label timing; 84 | private MaterialSkin.Controls.MaterialRaisedButton setup; 85 | private MaterialSkin.Controls.MaterialDivider materialDivider1; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /TextSender/SetSceneTiming.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using System; 3 | using System.Windows.Forms; 4 | 5 | namespace TextSender 6 | { 7 | public partial class SetSceneTiming : UserControl 8 | { 9 | private Log log; 10 | 11 | public SetSceneTiming() 12 | { 13 | log = new Log(GetType()); 14 | InitializeComponent(); 15 | } 16 | 17 | private string sceneName; 18 | private string sceneTiming; 19 | 20 | public string SceneName 21 | { 22 | get 23 | { 24 | return sceneName; 25 | } 26 | 27 | set 28 | { 29 | sceneName = value; 30 | name.Text = sceneName; 31 | } 32 | } 33 | 34 | public string SceneTiming 35 | { 36 | get 37 | { 38 | return sceneTiming; 39 | } 40 | 41 | set 42 | { 43 | sceneTiming = value; 44 | timing.Text = sceneTiming; 45 | } 46 | } 47 | 48 | private void setup_Click(object sender, EventArgs e) 49 | { 50 | frmSetTime frm = new frmSetTime(frmSetTime.Type.TimeOnly, SceneTiming); 51 | frm.timeChanged += sceneTimeChanged; 52 | frm.ShowDialog(); 53 | } 54 | 55 | private void sceneTimeChanged(object sender, frmSetTime.TimeChangedEventArgs e) 56 | { 57 | SceneTiming = e.Value; 58 | log.e("set SceneTiming :" + SceneTiming); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /TextSender/Singleton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | -------------------------------------------------------------------------------- /TextSender/comm/AdProgram.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | 9 | //生成的 json 与图片,视频文件打包成一个zip 10 | public class AdProgram 11 | { 12 | public int ver; //版本,兼容用 13 | public int sceneIntval; // scene轮播间隔 14 | public int backImageIntval; //底图轮播间隔 15 | public List backImage = new List(); //背景图 16 | public List scene = new List(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /TextSender/comm/Cmd.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Net.Sockets; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Linq; 7 | 8 | public static class Cmd 9 | { 10 | // socket port 11 | public const int broadcast_port = 41000; 12 | public const int cmd_port = 41001; 13 | public const int file_port = 41002; 14 | 15 | /// 16 | /// create buffer send to network, 4 bytes head + message body, head is message length 17 | /// 18 | public static byte[] create(Command cmd, string msg) 19 | { 20 | byte[] b = Encoding.UTF8.GetBytes("/" + cmd.ToString() + "/:" + msg + "\n"); 21 | // Send Length 22 | //byte[] front = BitConverter.GetBytes(back.Length); // 4 bytes 23 | //byte[] combined = front.Concat(back).ToArray(); 24 | 25 | Console.WriteLine("###createBuffer => " + cmd.ToString() + " " + msg); 26 | return b; 27 | } 28 | 29 | public static byte[] createBuffer2(string cmd, string msg) 30 | { 31 | byte[] back = Encoding.ASCII.GetBytes("/" + cmd + "/:" + msg + "\n"); 32 | // Send Length 33 | byte[] front = BitConverter.GetBytes(back.Length); // 4 bytes 34 | byte[] combined = front.Concat(back).ToArray(); 35 | 36 | Console.WriteLine("###createBuffer => " + cmd + " " + msg); 37 | return combined; 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /TextSender/comm/Command.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Net.Sockets; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Linq; 7 | 8 | public enum Command 9 | { 10 | // pc -> box 11 | server_ip, //广播pc ip 12 | server_close, //pc 关闭 13 | get_screen, //获取box 屏幕截图 14 | set_time, //设置时间 15 | send_ad, //发送ad 文件 16 | set_id, //设置 box id , 1 -255 17 | set_name, 18 | prev_scene, 19 | next_scene, 20 | set_volume, 21 | get_volume, 22 | reboot, 23 | install_apk, 24 | get_time, 25 | 26 | // box -> pc 27 | send_ad_ok, 28 | heartbeat, 29 | connect, 30 | screen_image, 31 | curr_volume, 32 | curr_time, 33 | clear, // delete all scene 34 | set_wan_ip, 35 | } 36 | -------------------------------------------------------------------------------- /TextSender/comm/Scene.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | 9 | 10 | public class Scene 11 | { 12 | public string timing; // 03:44 13 | public string name; 14 | public List layers = new List(); //表示 Video, Subtitle, Picture 的层次 15 | 16 | public List