首次提交:本地项目同步到Gitea

This commit is contained in:
zhusenlin
2026-01-24 08:45:54 +08:00
commit 4a6b23db69
256 changed files with 25311 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
/// <summary>
/// 新建形状的命令,
/// </summary>
public class CommandCreate : ShapeCommand
{
public override void Redo()
{
this.canvas.shapes.lstShapes.Add(this.NewShape);
//throw new NotImplementedException();
}
public override void Undo()
{
this.canvas.shapes.lstShapes.Remove(this.NewShape);
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public class CommandDelete : ShapeCommand
{
/// <summary>
/// 从哪一项删除的。
/// </summary>
public int index { get; set; }
public override void Redo()
{
// 重新删除
this.index = this.canvas.shapes.lstShapes.IndexOf(this.NewShape);
this.canvas.shapes.lstShapes.Remove(this.NewShape);
//throw new NotImplementedException();
}
public override void Undo()
{
// 从这个位置重新插入。
this.canvas.shapes.lstShapes.Insert(this.index, this.NewShape);
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
/// <summary>
/// 这个实际上没有用到我用CommandResize来统一了。
/// </summary>
public class CommandMove : ShapeCommand
{
}
}

View File

@@ -0,0 +1,23 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public class CommandPropertyChanged : ShapeCommand
{
public override void Redo()
{
this.canvas.shapes.replaceShape(this.OldShape.ID, this.NewShape);
//throw new NotImplementedException();
}
public override void Undo()
{
this.canvas.shapes.replaceShape(this.OldShape.ID, this.OldShape);
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public class CommandRecorder:ICommandRecorder
{
// 保存一堆的命令
private List<ICommand> commands = new List<ICommand>();
// 当前的下标
private int current_index = -1;
public void addCommand(ICommand command)
{
// 这里要判断是否是最后一个
if (current_index < commands.Count - 1)
{
// 说明后边还有,首先删除后边的
commands.RemoveRange(current_index + 1, commands.Count - current_index-1);
}
// 添加进去
commands.Add(command);
// 重新设置
current_index += 1;
}
public bool isRedoAble()
{
return current_index < this.commands.Count - 1;
//throw new NotImplementedException();
}
public bool isUndoAble()
{
return current_index > 0;
//throw new NotImplementedException();
}
public void Redo()
{
//
current_index += 1;// 往后退一步
if (current_index >= commands.Count) current_index = commands.Count - 1;// 不能再前进了。
// 这里表示有操作
if (current_index >= 0 && current_index < commands.Count)
{
commands[current_index].Redo();
}
}
public void Undo()
{
// 这里表示有操作
if (current_index >= 0 && current_index < commands.Count)
{
commands[current_index].Undo();
}
current_index -= 1;// 往后退一步
if (current_index < 0) current_index = -1;// 有最小的不能再退
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public class CommandResize : ShapeCommand
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
class CommandShapeBackward : ShapeCommand
{
// todo 命令
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
class CommandShapeBackwardToEnd : ShapeCommand
{
// todo 命令
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
class CommandShapeCancelGroup : ShapeCommand
{
// todo 命令
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public class CommandShapeForward:ShapeCommand
{
// todo 命令
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
class CommandShapeForwardToFront:ShapeCommand
{
// todo 命令
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
class CommandShapeMergeGroup : ShapeCommand
{
// todo 命令
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/**
* 我这里做一个省事,所有的更改都改成这种更改,而不是单独的区分了。
*
* **/
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
/// <summary>
/// Shapes的更改
/// </summary>
public class CommandShapesChanged:ICommand
{
/// <summary>
/// 原先的
/// </summary>
public Shapes OldShapes { get; set; }
/// <summary>
/// 新的
/// </summary>
public Shapes NewShapes { get; set; }
/// <summary>
/// 画布
/// </summary>
public UserControlCanvas canvas { get; set; }
public void Redo()
{
this.canvas.shapes = NewShapes;
//throw new NotImplementedException();
}
public void Undo()
{
this.canvas.shapes = OldShapes;
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public interface ICommand
{
void Undo();
void Redo();
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
public interface ICommandRecorder
{
void addCommand(ICommand command);
void Undo();
void Redo();
bool isUndoAble();
bool isRedoAble();
}
}

View File

@@ -0,0 +1,35 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Command
{
/// <summary>
/// 形状方面的命令。
/// </summary>
public abstract class ShapeCommand: ICommand
{
/// <summary>
/// 原先的形状
/// </summary>
public ShapeEle OldShape { get; set; }
/// <summary>
/// 新的形状
/// </summary>
public ShapeEle NewShape { get; set; }
/// <summary>
/// 画布
/// </summary>
public UserControlCanvas canvas { get; set; }
// 如下是两个操作。
public virtual void Undo() { this.canvas.shapes.replaceShape(this.OldShape.ID, this.NewShape); }
public virtual void Redo() { this.canvas.shapes.replaceShape(this.OldShape.ID, this.OldShape); }
}
}

View File

@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using ZXing;
namespace Io.Github.Kerwinxu.LibShapes.Core.Converter
{
/// <summary>
/// 显示条形码编码类型
/// </summary>
[Serializable]
//[ProtoContract]
public class BarcodeEncodingConverter : StringConverter
{
//我现在只能用这种静态的方式来搞定这个了。
//public static string[] arrVarName = { "AZTEC", "EAN13", "EAN8", "CODE_39", "QR_CODE" };
public static Dictionary<string, BarcodeFormat> dictBarcode = new Dictionary<string, BarcodeFormat>();
static BarcodeEncodingConverter()
{
//支持这么多编码。
dictBarcode.Add("AZTEC", BarcodeFormat.AZTEC);
dictBarcode.Add("CODABAR", BarcodeFormat.CODABAR);
dictBarcode.Add("CODE_39", BarcodeFormat.CODE_39);
dictBarcode.Add("CODE_93", BarcodeFormat.CODE_93);
dictBarcode.Add("CODE_128", BarcodeFormat.CODE_128);
dictBarcode.Add("DATA_MATRIX", BarcodeFormat.DATA_MATRIX);
dictBarcode.Add("EAN_8", BarcodeFormat.EAN_8);
dictBarcode.Add("EAN_13", BarcodeFormat.EAN_13);
dictBarcode.Add("ITF", BarcodeFormat.ITF);
dictBarcode.Add("MAXICODE", BarcodeFormat.MAXICODE);
dictBarcode.Add("PDF_417", BarcodeFormat.PDF_417);
dictBarcode.Add("QR_CODE", BarcodeFormat.QR_CODE);
dictBarcode.Add("RSS_14", BarcodeFormat.RSS_14);
dictBarcode.Add("RSS_EXPANDED", BarcodeFormat.RSS_EXPANDED);
dictBarcode.Add("UPC_A", BarcodeFormat.UPC_A);
dictBarcode.Add("UPC_E", BarcodeFormat.UPC_E);
dictBarcode.Add("All_1D", BarcodeFormat.All_1D);
dictBarcode.Add("UPC_EAN_EXTENSION", BarcodeFormat.UPC_EAN_EXTENSION);
dictBarcode.Add("MSI", BarcodeFormat.MSI);
dictBarcode.Add("PLESSEY", BarcodeFormat.PLESSEY);
dictBarcode.Add("IMB", BarcodeFormat.IMB);
}
//覆盖 GetStandardValuesSupported 方法并返回 true ,表示此对象支持可以从列表中选取的一组标准值。
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
/// <summary>
/// 覆盖 GetStandardValues 方法并返回填充了标准值的 StandardValuesCollection 。
/// 创建 StandardValuesCollection 的方法之一是在构造函数中提供一个值数组。
/// 对于选项窗口应用程序,您可以使用填充了建议的默认文件名的 String 数组。
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
//return new StandardValuesCollection(arrVarName);
return new StandardValuesCollection(dictBarcode.Keys);
}
//如下这样就会变成组合框
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return false;
}
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using ZXing.QrCode.Internal;
namespace Io.Github.Kerwinxu.LibShapes.Core.Converter
{
/// <summary>
///
/// </summary>
public class QrCodeErrorCorrectionLevelConverter : StringConverter
{
// 1. 一个静态的属性
public static Dictionary<string, ErrorCorrectionLevel> level = new Dictionary<string, ErrorCorrectionLevel>();
// 2. 静态的构造方法,主要是构造上边的属性
static QrCodeErrorCorrectionLevelConverter()
{
level.Add("容错7%", ErrorCorrectionLevel.L);
level.Add("容错15%", ErrorCorrectionLevel.M);
level.Add("容错25%", ErrorCorrectionLevel.Q);
level.Add("容错30%", ErrorCorrectionLevel.H);
}
//3. 覆盖 GetStandardValuesSupported 方法并返回 true ,表示此对象支持可以从列表中选取的一组标准值。
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
//4.
/// <summary>
/// 覆盖 GetStandardValues 方法并返回填充了标准值的 StandardValuesCollection 。
/// 创建 StandardValuesCollection 的方法之一是在构造函数中提供一个值数组。
/// 对于选项窗口应用程序,您可以使用填充了建议的默认文件名的 String 数组。
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
//return new StandardValuesCollection(arrVarName);
return new StandardValuesCollection(level.Keys);
}
//5.
//如下这样就会变成组合框
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return false;
}
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Event
{
/// <summary>
/// 对象被选择事件
/// </summary>
public class ObjectSelectEventArgs : EventArgs
{
/// <summary>
/// 这个被选择了
/// </summary>
public Object obj { get; set; }
public ObjectSelectEventArgs(Object obj)
{
this.obj = obj;
}
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Event
{
/// <summary>
/// 状态改变的事件
/// </summary>
public class StateChangedEventArgs : EventArgs
{
public State.State CurrentState { get; set; }
public StateChangedEventArgs(State.State state)
{
this.CurrentState = state;
}
}
}

View File

@@ -0,0 +1,900 @@
namespace Io.Github.Kerwinxu.LibShapes.Core.Paper
{
partial class FrmPaperSetting
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPagePaper = new System.Windows.Forms.TabPage();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.comboPrinters = new System.Windows.Forms.ComboBox();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.comboPaperSizes = new System.Windows.Forms.ComboBox();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.btn_paper_ok = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.txt_paper_width = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.txt_paper_height = new System.Windows.Forms.TextBox();
this.groupBox10 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.tabPageLayout = new System.Windows.Forms.TabPage();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.chkCustomInterval = new System.Windows.Forms.CheckBox();
this.txtHorizontalInterval = new System.Windows.Forms.TextBox();
this.txtVerticalInterval = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.chkCustomModelSize = new System.Windows.Forms.CheckBox();
this.txtModelWidth = new System.Windows.Forms.TextBox();
this.txtModelHeight = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtMaginsTop = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.txtMaginsLeft = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtMaginsRight = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtMaginsBottom = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.UpDownNumberOfColumn = new System.Windows.Forms.NumericUpDown();
this.UpDownNumberOfLine = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.tabPageShapes = new System.Windows.Forms.TabPage();
this.groupBoxRect = new System.Windows.Forms.GroupBox();
this.chkEllipseHole = new System.Windows.Forms.CheckBox();
this.txtEllipseHoleRadius = new System.Windows.Forms.TextBox();
this.lblEllipseHoleRadius = new System.Windows.Forms.Label();
this.txtRoundRadius = new System.Windows.Forms.TextBox();
this.lblRoundRadius = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.radioButtonRoundRect = new System.Windows.Forms.RadioButton();
this.radioButtonEllipse = new System.Windows.Forms.RadioButton();
this.radioButtonRect = new System.Windows.Forms.RadioButton();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.lblModelSize = new System.Windows.Forms.Label();
this.lblPaperSize = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.tabControl1.SuspendLayout();
this.tabPagePaper.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.groupBox6.SuspendLayout();
this.groupBox9.SuspendLayout();
this.groupBox7.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.groupBox10.SuspendLayout();
this.tabPageLayout.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.UpDownNumberOfColumn)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.UpDownNumberOfLine)).BeginInit();
this.tabPageShapes.SuspendLayout();
this.groupBoxRect.SuspendLayout();
this.groupBox5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPagePaper);
this.tabControl1.Controls.Add(this.tabPageLayout);
this.tabControl1.Controls.Add(this.tabPageShapes);
this.tabControl1.Location = new System.Drawing.Point(12, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(318, 419);
this.tabControl1.TabIndex = 1;
//
// tabPagePaper
//
this.tabPagePaper.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.tabPagePaper.Controls.Add(this.flowLayoutPanel1);
this.tabPagePaper.Location = new System.Drawing.Point(4, 22);
this.tabPagePaper.Name = "tabPagePaper";
this.tabPagePaper.Padding = new System.Windows.Forms.Padding(3);
this.tabPagePaper.Size = new System.Drawing.Size(310, 393);
this.tabPagePaper.TabIndex = 0;
this.tabPagePaper.Text = "纸张";
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.groupBox6);
this.flowLayoutPanel1.Controls.Add(this.groupBox9);
this.flowLayoutPanel1.Controls.Add(this.groupBox7);
this.flowLayoutPanel1.Controls.Add(this.groupBox10);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(304, 387);
this.flowLayoutPanel1.TabIndex = 0;
//
// groupBox6
//
this.groupBox6.Controls.Add(this.comboPrinters);
this.groupBox6.Location = new System.Drawing.Point(3, 3);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(298, 58);
this.groupBox6.TabIndex = 5;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "打印机";
//
// comboPrinters
//
this.comboPrinters.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboPrinters.FormattingEnabled = true;
this.comboPrinters.Location = new System.Drawing.Point(6, 20);
this.comboPrinters.Name = "comboPrinters";
this.comboPrinters.Size = new System.Drawing.Size(286, 20);
this.comboPrinters.TabIndex = 1;
this.comboPrinters.SelectedIndexChanged += new System.EventHandler(this.comboPrinters_SelectedIndexChanged);
//
// groupBox9
//
this.groupBox9.Controls.Add(this.comboPaperSizes);
this.groupBox9.Location = new System.Drawing.Point(3, 67);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(298, 58);
this.groupBox9.TabIndex = 4;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "纸张大小";
//
// comboPaperSizes
//
this.comboPaperSizes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboPaperSizes.FormattingEnabled = true;
this.comboPaperSizes.Location = new System.Drawing.Point(6, 20);
this.comboPaperSizes.Name = "comboPaperSizes";
this.comboPaperSizes.Size = new System.Drawing.Size(286, 20);
this.comboPaperSizes.TabIndex = 1;
this.comboPaperSizes.SelectedValueChanged += new System.EventHandler(this.comboPaperSizes_SelectedValueChanged);
//
// groupBox7
//
this.groupBox7.Controls.Add(this.btn_paper_ok);
this.groupBox7.Controls.Add(this.tableLayoutPanel1);
this.groupBox7.Location = new System.Drawing.Point(3, 131);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(298, 97);
this.groupBox7.TabIndex = 6;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "纸张自定义";
//
// btn_paper_ok
//
this.btn_paper_ok.Location = new System.Drawing.Point(189, 55);
this.btn_paper_ok.Name = "btn_paper_ok";
this.btn_paper_ok.Size = new System.Drawing.Size(75, 23);
this.btn_paper_ok.TabIndex = 1;
this.btn_paper_ok.Text = "确定";
this.btn_paper_ok.UseVisualStyleBackColor = true;
this.btn_paper_ok.Click += new System.EventHandler(this.btn_paper_ok_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 48.3871F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 51.6129F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 31F));
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.txt_paper_width, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label14, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label15, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.txt_paper_height, 1, 1);
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 20);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(177, 62);
this.tableLayoutPanel1.TabIndex = 0;
//
// label1
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(14, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
this.label1.Text = "宽度:";
//
// txt_paper_width
//
this.txt_paper_width.Location = new System.Drawing.Point(73, 3);
this.txt_paper_width.Name = "txt_paper_width";
this.txt_paper_width.Size = new System.Drawing.Size(63, 21);
this.txt_paper_width.TabIndex = 2;
//
// label14
//
this.label14.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(152, 9);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(17, 12);
this.label14.TabIndex = 4;
this.label14.Text = "mm";
//
// label2
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(14, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 1;
this.label2.Text = "高度:";
//
// label15
//
this.label15.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(152, 40);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(17, 12);
this.label15.TabIndex = 5;
this.label15.Text = "mm";
//
// txt_paper_height
//
this.txt_paper_height.Location = new System.Drawing.Point(73, 34);
this.txt_paper_height.Name = "txt_paper_height";
this.txt_paper_height.Size = new System.Drawing.Size(63, 21);
this.txt_paper_height.TabIndex = 3;
//
// groupBox10
//
this.groupBox10.Controls.Add(this.radioButton2);
this.groupBox10.Controls.Add(this.radioButton1);
this.groupBox10.Location = new System.Drawing.Point(3, 234);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(298, 69);
this.groupBox10.TabIndex = 5;
this.groupBox10.TabStop = false;
this.groupBox10.Text = "方向";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(6, 42);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(47, 16);
this.radioButton2.TabIndex = 4;
this.radioButton2.Text = "横向";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(6, 20);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(47, 16);
this.radioButton1.TabIndex = 4;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "纵向";
this.radioButton1.UseVisualStyleBackColor = true;
//
// tabPageLayout
//
this.tabPageLayout.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.tabPageLayout.Controls.Add(this.groupBox4);
this.tabPageLayout.Controls.Add(this.groupBox3);
this.tabPageLayout.Controls.Add(this.groupBox2);
this.tabPageLayout.Controls.Add(this.groupBox1);
this.tabPageLayout.Location = new System.Drawing.Point(4, 22);
this.tabPageLayout.Name = "tabPageLayout";
this.tabPageLayout.Padding = new System.Windows.Forms.Padding(3);
this.tabPageLayout.Size = new System.Drawing.Size(310, 393);
this.tabPageLayout.TabIndex = 1;
this.tabPageLayout.Text = "布局";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.chkCustomInterval);
this.groupBox4.Controls.Add(this.txtHorizontalInterval);
this.groupBox4.Controls.Add(this.txtVerticalInterval);
this.groupBox4.Controls.Add(this.label12);
this.groupBox4.Controls.Add(this.label13);
this.groupBox4.Location = new System.Drawing.Point(6, 284);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(291, 100);
this.groupBox4.TabIndex = 19;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "模板间距";
//
// chkCustomInterval
//
this.chkCustomInterval.AutoSize = true;
this.chkCustomInterval.Enabled = false;
this.chkCustomInterval.Location = new System.Drawing.Point(193, 45);
this.chkCustomInterval.Name = "chkCustomInterval";
this.chkCustomInterval.Size = new System.Drawing.Size(72, 16);
this.chkCustomInterval.TabIndex = 18;
this.chkCustomInterval.Text = "手动设置";
this.chkCustomInterval.UseVisualStyleBackColor = true;
this.chkCustomInterval.Visible = false;
this.chkCustomInterval.CheckedChanged += new System.EventHandler(this.chkCustomInterval_CheckedChanged);
//
// txtHorizontalInterval
//
this.txtHorizontalInterval.Enabled = false;
this.txtHorizontalInterval.Location = new System.Drawing.Point(56, 23);
this.txtHorizontalInterval.Name = "txtHorizontalInterval";
this.txtHorizontalInterval.Size = new System.Drawing.Size(76, 21);
this.txtHorizontalInterval.TabIndex = 14;
this.txtHorizontalInterval.Text = "0";
this.txtHorizontalInterval.TextChanged += new System.EventHandler(this.txtHorizontalInterval_TextChanged);
//
// txtVerticalInterval
//
this.txtVerticalInterval.Enabled = false;
this.txtVerticalInterval.Location = new System.Drawing.Point(56, 60);
this.txtVerticalInterval.Name = "txtVerticalInterval";
this.txtVerticalInterval.Size = new System.Drawing.Size(76, 21);
this.txtVerticalInterval.TabIndex = 17;
this.txtVerticalInterval.Text = "0";
this.txtVerticalInterval.TextChanged += new System.EventHandler(this.txtHorizontalInterval_TextChanged);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(9, 63);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(29, 12);
this.label12.TabIndex = 15;
this.label12.Text = "垂直";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(9, 26);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(29, 12);
this.label13.TabIndex = 16;
this.label13.Text = "水平";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.chkCustomModelSize);
this.groupBox3.Controls.Add(this.txtModelWidth);
this.groupBox3.Controls.Add(this.txtModelHeight);
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Controls.Add(this.label7);
this.groupBox3.Location = new System.Drawing.Point(6, 178);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(291, 100);
this.groupBox3.TabIndex = 17;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "模板大小";
//
// chkCustomModelSize
//
this.chkCustomModelSize.AutoSize = true;
this.chkCustomModelSize.Checked = true;
this.chkCustomModelSize.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkCustomModelSize.Location = new System.Drawing.Point(193, 43);
this.chkCustomModelSize.Name = "chkCustomModelSize";
this.chkCustomModelSize.Size = new System.Drawing.Size(72, 16);
this.chkCustomModelSize.TabIndex = 18;
this.chkCustomModelSize.Text = "手动设置";
this.chkCustomModelSize.UseVisualStyleBackColor = true;
this.chkCustomModelSize.CheckedChanged += new System.EventHandler(this.chkCustomModelSize_CheckedChanged);
//
// txtModelWidth
//
this.txtModelWidth.Location = new System.Drawing.Point(53, 23);
this.txtModelWidth.Name = "txtModelWidth";
this.txtModelWidth.Size = new System.Drawing.Size(76, 21);
this.txtModelWidth.TabIndex = 14;
this.txtModelWidth.Text = "10";
this.txtModelWidth.TextChanged += new System.EventHandler(this.txtModelWidth_TextChanged);
//
// txtModelHeight
//
this.txtModelHeight.Location = new System.Drawing.Point(53, 60);
this.txtModelHeight.Name = "txtModelHeight";
this.txtModelHeight.Size = new System.Drawing.Size(76, 21);
this.txtModelHeight.TabIndex = 17;
this.txtModelHeight.Text = "10";
this.txtModelHeight.TextChanged += new System.EventHandler(this.txtModelWidth_TextChanged);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(9, 63);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(29, 12);
this.label4.TabIndex = 15;
this.label4.Text = "高度";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(9, 26);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(29, 12);
this.label7.TabIndex = 16;
this.label7.Text = "宽度";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtMaginsTop);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.txtMaginsLeft);
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.txtMaginsRight);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.txtMaginsBottom);
this.groupBox2.Location = new System.Drawing.Point(3, 76);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(291, 96);
this.groupBox2.TabIndex = 16;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "边距";
//
// txtMaginsTop
//
this.txtMaginsTop.Location = new System.Drawing.Point(56, 20);
this.txtMaginsTop.Name = "txtMaginsTop";
this.txtMaginsTop.Size = new System.Drawing.Size(76, 21);
this.txtMaginsTop.TabIndex = 6;
this.txtMaginsTop.Text = "0";
this.txtMaginsTop.TextChanged += new System.EventHandler(this.txtMaginsTop_TextChanged);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(149, 60);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(17, 12);
this.label8.TabIndex = 7;
this.label8.Text = "右";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(12, 60);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(17, 12);
this.label9.TabIndex = 8;
this.label9.Text = "下";
//
// txtMaginsLeft
//
this.txtMaginsLeft.Location = new System.Drawing.Point(196, 20);
this.txtMaginsLeft.Name = "txtMaginsLeft";
this.txtMaginsLeft.Size = new System.Drawing.Size(76, 21);
this.txtMaginsLeft.TabIndex = 13;
this.txtMaginsLeft.Text = "0";
this.txtMaginsLeft.TextChanged += new System.EventHandler(this.txtMaginsTop_TextChanged);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(149, 23);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(17, 12);
this.label10.TabIndex = 9;
this.label10.Text = "左";
//
// txtMaginsRight
//
this.txtMaginsRight.Location = new System.Drawing.Point(196, 57);
this.txtMaginsRight.Name = "txtMaginsRight";
this.txtMaginsRight.Size = new System.Drawing.Size(76, 21);
this.txtMaginsRight.TabIndex = 12;
this.txtMaginsRight.Text = "0";
this.txtMaginsRight.TextChanged += new System.EventHandler(this.txtMaginsTop_TextChanged);
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(12, 23);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(17, 12);
this.label11.TabIndex = 10;
this.label11.Text = "上";
//
// txtMaginsBottom
//
this.txtMaginsBottom.Location = new System.Drawing.Point(56, 57);
this.txtMaginsBottom.Name = "txtMaginsBottom";
this.txtMaginsBottom.Size = new System.Drawing.Size(76, 21);
this.txtMaginsBottom.TabIndex = 11;
this.txtMaginsBottom.Text = "0";
this.txtMaginsBottom.TextChanged += new System.EventHandler(this.txtMaginsTop_TextChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.UpDownNumberOfColumn);
this.groupBox1.Controls.Add(this.UpDownNumberOfLine);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Location = new System.Drawing.Point(3, 6);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(296, 64);
this.groupBox1.TabIndex = 15;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "布局";
//
// UpDownNumberOfColumn
//
this.UpDownNumberOfColumn.Location = new System.Drawing.Point(196, 20);
this.UpDownNumberOfColumn.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.UpDownNumberOfColumn.Name = "UpDownNumberOfColumn";
this.UpDownNumberOfColumn.Size = new System.Drawing.Size(76, 21);
this.UpDownNumberOfColumn.TabIndex = 6;
this.UpDownNumberOfColumn.Value = new decimal(new int[] {
2,
0,
0,
0});
this.UpDownNumberOfColumn.ValueChanged += new System.EventHandler(this.UpDownNumberOfLine_ValueChanged);
//
// UpDownNumberOfLine
//
this.UpDownNumberOfLine.Location = new System.Drawing.Point(56, 21);
this.UpDownNumberOfLine.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.UpDownNumberOfLine.Name = "UpDownNumberOfLine";
this.UpDownNumberOfLine.Size = new System.Drawing.Size(76, 21);
this.UpDownNumberOfLine.TabIndex = 5;
this.UpDownNumberOfLine.Value = new decimal(new int[] {
2,
0,
0,
0});
this.UpDownNumberOfLine.ValueChanged += new System.EventHandler(this.UpDownNumberOfLine_ValueChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 23);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(41, 12);
this.label5.TabIndex = 1;
this.label5.Text = "行数:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(149, 23);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(41, 12);
this.label6.TabIndex = 2;
this.label6.Text = "列数:";
//
// tabPageShapes
//
this.tabPageShapes.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.tabPageShapes.Controls.Add(this.groupBoxRect);
this.tabPageShapes.Controls.Add(this.groupBox5);
this.tabPageShapes.Location = new System.Drawing.Point(4, 22);
this.tabPageShapes.Name = "tabPageShapes";
this.tabPageShapes.Padding = new System.Windows.Forms.Padding(3);
this.tabPageShapes.Size = new System.Drawing.Size(310, 393);
this.tabPageShapes.TabIndex = 2;
this.tabPageShapes.Text = "形状";
//
// groupBoxRect
//
this.groupBoxRect.Controls.Add(this.chkEllipseHole);
this.groupBoxRect.Controls.Add(this.txtEllipseHoleRadius);
this.groupBoxRect.Controls.Add(this.lblEllipseHoleRadius);
this.groupBoxRect.Controls.Add(this.txtRoundRadius);
this.groupBoxRect.Controls.Add(this.lblRoundRadius);
this.groupBoxRect.Location = new System.Drawing.Point(6, 119);
this.groupBoxRect.Name = "groupBoxRect";
this.groupBoxRect.Size = new System.Drawing.Size(298, 139);
this.groupBoxRect.TabIndex = 1;
this.groupBoxRect.TabStop = false;
this.groupBoxRect.Text = "选项";
//
// chkEllipseHole
//
this.chkEllipseHole.AutoSize = true;
this.chkEllipseHole.Location = new System.Drawing.Point(15, 73);
this.chkEllipseHole.Name = "chkEllipseHole";
this.chkEllipseHole.Size = new System.Drawing.Size(36, 16);
this.chkEllipseHole.TabIndex = 7;
this.chkEllipseHole.Text = "孔";
this.chkEllipseHole.UseVisualStyleBackColor = true;
//
// txtEllipseHoleRadius
//
this.txtEllipseHoleRadius.Location = new System.Drawing.Point(72, 95);
this.txtEllipseHoleRadius.Name = "txtEllipseHoleRadius";
this.txtEllipseHoleRadius.Size = new System.Drawing.Size(100, 21);
this.txtEllipseHoleRadius.TabIndex = 5;
//
// lblEllipseHoleRadius
//
this.lblEllipseHoleRadius.AutoSize = true;
this.lblEllipseHoleRadius.Location = new System.Drawing.Point(34, 98);
this.lblEllipseHoleRadius.Name = "lblEllipseHoleRadius";
this.lblEllipseHoleRadius.Size = new System.Drawing.Size(29, 12);
this.lblEllipseHoleRadius.TabIndex = 4;
this.lblEllipseHoleRadius.Text = "孔径";
//
// txtRoundRadius
//
this.txtRoundRadius.Location = new System.Drawing.Point(72, 42);
this.txtRoundRadius.Name = "txtRoundRadius";
this.txtRoundRadius.Size = new System.Drawing.Size(100, 21);
this.txtRoundRadius.TabIndex = 2;
//
// lblRoundRadius
//
this.lblRoundRadius.AutoSize = true;
this.lblRoundRadius.Location = new System.Drawing.Point(13, 48);
this.lblRoundRadius.Name = "lblRoundRadius";
this.lblRoundRadius.Size = new System.Drawing.Size(53, 12);
this.lblRoundRadius.TabIndex = 1;
this.lblRoundRadius.Text = "圆角半径";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.radioButtonRoundRect);
this.groupBox5.Controls.Add(this.radioButtonEllipse);
this.groupBox5.Controls.Add(this.radioButtonRect);
this.groupBox5.Location = new System.Drawing.Point(6, 18);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(298, 95);
this.groupBox5.TabIndex = 0;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "模板形状";
//
// radioButtonRoundRect
//
this.radioButtonRoundRect.AutoSize = true;
this.radioButtonRoundRect.Location = new System.Drawing.Point(15, 44);
this.radioButtonRoundRect.Name = "radioButtonRoundRect";
this.radioButtonRoundRect.Size = new System.Drawing.Size(71, 16);
this.radioButtonRoundRect.TabIndex = 2;
this.radioButtonRoundRect.Text = "圆角矩形";
this.radioButtonRoundRect.UseVisualStyleBackColor = true;
this.radioButtonRoundRect.CheckedChanged += new System.EventHandler(this.radioButtonRect_CheckedChanged);
//
// radioButtonEllipse
//
this.radioButtonEllipse.AutoSize = true;
this.radioButtonEllipse.Location = new System.Drawing.Point(15, 66);
this.radioButtonEllipse.Name = "radioButtonEllipse";
this.radioButtonEllipse.Size = new System.Drawing.Size(47, 16);
this.radioButtonEllipse.TabIndex = 1;
this.radioButtonEllipse.Text = "椭圆";
this.radioButtonEllipse.UseVisualStyleBackColor = true;
this.radioButtonEllipse.CheckedChanged += new System.EventHandler(this.radioButtonRect_CheckedChanged);
//
// radioButtonRect
//
this.radioButtonRect.AutoSize = true;
this.radioButtonRect.Checked = true;
this.radioButtonRect.Location = new System.Drawing.Point(15, 20);
this.radioButtonRect.Name = "radioButtonRect";
this.radioButtonRect.Size = new System.Drawing.Size(47, 16);
this.radioButtonRect.TabIndex = 0;
this.radioButtonRect.TabStop = true;
this.radioButtonRect.Text = "方框";
this.radioButtonRect.UseVisualStyleBackColor = true;
this.radioButtonRect.CheckedChanged += new System.EventHandler(this.radioButtonRect_CheckedChanged);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(447, 437);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 15;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOk
//
this.btnOk.Location = new System.Drawing.Point(140, 437);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 14;
this.btnOk.Text = "确定";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// lblModelSize
//
this.lblModelSize.AutoSize = true;
this.lblModelSize.Location = new System.Drawing.Point(366, 402);
this.lblModelSize.Name = "lblModelSize";
this.lblModelSize.Size = new System.Drawing.Size(65, 12);
this.lblModelSize.TabIndex = 13;
this.lblModelSize.Text = "模板大小:";
//
// lblPaperSize
//
this.lblPaperSize.AutoSize = true;
this.lblPaperSize.Location = new System.Drawing.Point(366, 376);
this.lblPaperSize.Name = "lblPaperSize";
this.lblPaperSize.Size = new System.Drawing.Size(65, 12);
this.lblPaperSize.TabIndex = 12;
this.lblPaperSize.Text = "纸张尺寸:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(331, 20);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(29, 12);
this.label3.TabIndex = 11;
this.label3.Text = "预览";
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Location = new System.Drawing.Point(331, 38);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(336, 335);
this.pictureBox1.TabIndex = 10;
this.pictureBox1.TabStop = false;
this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint);
//
// FrmPaperSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(677, 475);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.lblModelSize);
this.Controls.Add(this.lblPaperSize);
this.Controls.Add(this.label3);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.tabControl1);
this.Name = "FrmPaperSetting";
this.Text = "纸张设置";
this.tabControl1.ResumeLayout(false);
this.tabPagePaper.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
this.groupBox7.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.groupBox10.ResumeLayout(false);
this.groupBox10.PerformLayout();
this.tabPageLayout.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.UpDownNumberOfColumn)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.UpDownNumberOfLine)).EndInit();
this.tabPageShapes.ResumeLayout(false);
this.groupBoxRect.ResumeLayout(false);
this.groupBoxRect.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPagePaper;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.ComboBox comboPrinters;
private System.Windows.Forms.GroupBox groupBox9;
private System.Windows.Forms.ComboBox comboPaperSizes;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.Button btn_paper_ok;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_paper_width;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox txt_paper_height;
private System.Windows.Forms.GroupBox groupBox10;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.TabPage tabPageLayout;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox chkCustomInterval;
private System.Windows.Forms.TextBox txtHorizontalInterval;
private System.Windows.Forms.TextBox txtVerticalInterval;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox chkCustomModelSize;
private System.Windows.Forms.TextBox txtModelWidth;
private System.Windows.Forms.TextBox txtModelHeight;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtMaginsTop;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtMaginsLeft;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtMaginsRight;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtMaginsBottom;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.NumericUpDown UpDownNumberOfColumn;
private System.Windows.Forms.NumericUpDown UpDownNumberOfLine;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TabPage tabPageShapes;
private System.Windows.Forms.GroupBox groupBoxRect;
private System.Windows.Forms.CheckBox chkEllipseHole;
private System.Windows.Forms.TextBox txtEllipseHoleRadius;
private System.Windows.Forms.Label lblEllipseHoleRadius;
private System.Windows.Forms.TextBox txtRoundRadius;
private System.Windows.Forms.Label lblRoundRadius;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.RadioButton radioButtonRoundRect;
private System.Windows.Forms.RadioButton radioButtonEllipse;
private System.Windows.Forms.RadioButton radioButtonRect;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Label lblModelSize;
private System.Windows.Forms.Label lblPaperSize;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.PictureBox pictureBox1;
}
}

View File

@@ -0,0 +1,381 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.Paper
{
public partial class FrmPaperSetting : Form , IPaperSetting
{
/// <summary>
/// 修改的是这个变量
/// </summary>
private Paper paper = new Paper();
/// <summary>
/// 这个是要返回的
/// </summary>
private Paper result;
public FrmPaperSetting()
{
InitializeComponent();
init_printer();
}
public FrmPaperSetting(Paper paper):this()
{
this.paper = paper;
isOnlyOne = true;
paper_to_ui();
isOnlyOne = false;
}
/// <summary>
/// 初始化打印机
/// </summary>
private void init_printer()
{
foreach (var item in PrinterSettings.InstalledPrinters)
{
comboPrinters.Items.Add(item);
}
}
public Paper GetPaper()
{
return this.result;
//throw new NotImplementedException();
}
private bool isOnlyOne;
/// <summary>
/// 界面上数据发生改变
/// </summary>
private void change()
{
// 有这个标志,表示当前只能有一个在修改。
if (isOnlyOne)
{
return;
}
isOnlyOne = true;
// 先更新数据
if (ui_to_paper() && compute())
{
paper_to_ui(); // 然后计算,最后更新到界面
this.pictureBox1.Refresh();
this.lblModelSize.Text = $"模板大小:{this.paper.ModelWidth} * {this.paper.ModelHeight}";
this.lblPaperSize.Text = $"纸张大小:{this.paper.PaperWidth} * {this.paper.PaperHeight}";
}
isOnlyOne = false;
}
private bool compute()
{
// 我这里简化一下,自定义模板尺寸和自定义模板的间距,两个得有一个是可以手动设置,而另一个是自动的
// 解方程 纸张的宽度 = 左边距 + 列数 * 模板的宽度 + (列数-1*模板的间距 + 右边距
if (!chkCustomModelSize.Checked)
{
// 这个模板间距是手动设置的,那么我就要计算的是模板的大小了
this.paper.ModelWidth = (this.paper.PaperWidth - this.paper.Left - this.paper.Right - (this.paper.Cols - 1) * this.paper.HorizontalIntervalDistance) / this.paper.Cols;
this.paper.ModelHeight = (this.paper.PaperHeight - this.paper.Top - this.paper.Bottom - (this.paper.Rows - 1) * this.paper.VerticalIntervalDistance) / this.paper.Rows;
if (this.paper.ModelHeight < 0 || this.paper.ModelWidth < 0)
{
return false;
}
}
// 这里暂时只支持是否手动更改模板的尺寸,不支持自动计算模板间距。
//else
//{
// // 自定义了模板,要求的是模板的边距了
// // 这里要判断是否是一行或者一列
// if(this.paper.Cols == 1)
// {
// this.paper.HorizontalIntervalDistance = 0;
// }
// else
// {
// this.paper.HorizontalIntervalDistance = (this.paper.PaperWidth - this.paper.Left - this.paper.Right - this.paper.Cols * this.paper.ModelWidth) / (this.paper.Cols - 1);
// }
// if (this.paper.Rows == 1)
// {
// this.paper.VerticalIntervalDistance = 0;
// }
// else
// {
// this.paper.VerticalIntervalDistance = (this.paper.PaperHeight - this.paper.Top - this.paper.Bottom - this.paper.Rows * this.paper.ModelHeight) / (this.paper.Rows - 1);
// }
// if (this.paper.HorizontalIntervalDistance < 0 || this.paper.VerticalIntervalDistance < 0)
// {
// return false;
// }
//}
return true;
}
private bool ui_to_paper()
{
// 这里将ui中的信息全部转到paper中
try
{
this.paper.PaperWidth = float.Parse(txt_paper_width.Text);
this.paper.PaperHeight = float.Parse(txt_paper_height.Text);
this.paper.Landscape = !radioButton1.Checked;// 纵向
this.paper.Rows = (int)UpDownNumberOfLine.Value;
this.paper.Cols = (int)UpDownNumberOfColumn.Value;
this.paper.Top = float.Parse(txtMaginsTop.Text);
this.paper.Bottom = float.Parse(txtMaginsBottom.Text);
this.paper.Left = float.Parse(txtMaginsLeft.Text);
this.paper.Right = float.Parse(txtMaginsRight.Text);
//
this.paper.ModelWidth = float.Parse(txtModelWidth.Text);
this.paper.ModelHeight = float.Parse(txtModelHeight.Text);
//
this.paper.HorizontalIntervalDistance = float.Parse(txtHorizontalInterval.Text);
this.paper.VerticalIntervalDistance = float.Parse(txtVerticalInterval.Text);
if (radioButtonRect.Checked)
{
this.paper.ModelShape = new Shape.ShapeRectangle(); // 矩形
}else if (radioButtonRoundRect.Checked)
{
this.paper.ModelShape = new Shape.ShapeRoundedRectangle(); // 圆角矩形
}
else
{
this.paper.ModelShape = new Shape.ShapeEllipse(); // 椭圆
}
// 设置填充白色
this.paper.ModelShape.IsFill = true;
this.paper.ModelShape.FillColor = Color.White;
// 设置这个纸张的宽和高
this.paper.ModelShape.Height = this.paper.ModelHeight;
this.paper.ModelShape.Width = this.paper.ModelWidth;
return true;
}
catch (Exception ex)
{
MessageBox.Show("转换失败:" + ex.Message);
return false;
//throw;
}
}
private void paper_to_ui()
{
txt_paper_width.Text = this.paper.PaperWidth.ToString();
txt_paper_height.Text = this.paper.PaperHeight.ToString();
if (this.paper.Landscape) radioButton2.Checked = true; else radioButton1.Checked = true;
UpDownNumberOfLine.Value = this.paper.Rows;
UpDownNumberOfColumn.Value = this.paper.Cols;
txtMaginsTop.Text = this.paper.Top.ToString();
txtMaginsBottom.Text = this.paper.Bottom.ToString();
txtMaginsLeft.Text = this.paper.Left.ToString();
txtMaginsRight.Text = this.paper.Right.ToString();
txtModelWidth.Text = this.paper.ModelWidth.ToString();
txtModelHeight.Text = this.paper.ModelHeight.ToString();
txtHorizontalInterval.Text = this.paper.HorizontalIntervalDistance.ToString();
txtVerticalInterval.Text = this.paper.VerticalIntervalDistance.ToString();
if (this.paper.ModelShape is Shape.ShapeRectangle)
{
radioButtonRect.Checked = true;
}
else if (this.paper.ModelShape is Shape.ShapeRoundedRectangle)
{
radioButtonRoundRect.Checked = true;
}
else
{
radioButtonEllipse.Checked = true;
}
}
Dictionary<string, System.Drawing.Printing.PaperSize> dict_paperSize = new Dictionary<string, PaperSize>();
private void comboPrinters_SelectedIndexChanged(object sender, EventArgs e)
{
dict_paperSize.Clear();
// 打印机更改后需要更改有多少的纸张。
PrintDocument printDocument = new PrintDocument();
printDocument.PrinterSettings.PrinterName = comboPrinters.Text;// 打印机的名称
foreach (System.Drawing.Printing.PaperSize item in printDocument.PrinterSettings.PaperSizes)
{
dict_paperSize[item.ToString()] = item;
}
// 加载到组合框
string _old = comboPaperSizes.Text;
comboPaperSizes.Items.Clear();
comboPaperSizes.Items.AddRange(dict_paperSize.Keys.ToArray());
// 我这里看看是否有这个纸张
if (dict_paperSize.ContainsKey(_old))
{
//comboPaperSizes.Text = _old;
}
else
{
// 这里有新的纸张
comboPaperSizes.SelectedIndex = 0;
}
}
private void comboPaperSizes_SelectedValueChanged(object sender, EventArgs e)
{
if (dict_paperSize.ContainsKey(comboPaperSizes.Text))
{
var _papersize = dict_paperSize[comboPaperSizes.Text];
// 请注意,这里边的单位是以百分之一英寸为单位
txt_paper_height.Text = (_papersize.Height*0.254).ToString();
txt_paper_width.Text = (_papersize.Width*0.254).ToString();
change();
}
}
private void chkCustomInterval_CheckedChanged(object sender, EventArgs e)
{
txtHorizontalInterval.Enabled = chkCustomInterval.Checked;
txtVerticalInterval.Enabled = chkCustomInterval.Checked;
if (chkCustomInterval.Checked)
{
chkCustomModelSize.Checked = false;
}
}
private void chkCustomModelSize_CheckedChanged(object sender, EventArgs e)
{
// 这里要变成灰色的
txtModelHeight.Enabled = chkCustomModelSize.Checked;
txtModelWidth.Enabled = chkCustomModelSize.Checked;
if (chkCustomModelSize.Checked)
{
chkCustomInterval.Checked = false;
}
}
private void btn_paper_ok_Click(object sender, EventArgs e)
{
change();
}
private void UpDownNumberOfLine_ValueChanged(object sender, EventArgs e)
{
change();
}
private void txtMaginsTop_TextChanged(object sender, EventArgs e)
{
change();
}
private void txtModelWidth_TextChanged(object sender, EventArgs e)
{
// 要判断是否是手动
if(chkCustomModelSize.Checked) change();
}
private void txtHorizontalInterval_TextChanged(object sender, EventArgs e)
{
// 要判断是否是手动
if (chkCustomInterval.Checked) change();
}
private void btnOk_Click(object sender, EventArgs e)
{
//
this.DialogResult = DialogResult.OK; // 返回ok
this.Close(); // 关闭
result = paper; // 设置这个要返回的。
}
private void radioButtonRect_CheckedChanged(object sender, EventArgs e)
{
change();
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
try
{
// 做一个图形
Shapes shapes = new Shapes();
// 做一张纸
Shape.ShapeRectangle rect1 = new Shape.ShapeRectangle()
{
X = 0,
Y = 0,
Width = this.paper.PaperWidth, // todo 这里要注意横向
Height = this.paper.PaperHeight,
PenColor = Color.Red,
PenWidth = 1,
IsFill = true,
FillColor = Color.White,
};
shapes.lstShapes.Add(rect1);
////如下是绘制模板。
for (int i = 0; i < this.paper.Cols; i++)
{
for (int j = 0; j < this.paper.Rows; j++)
{
var tmp = this.paper.ModelShape.DeepClone();
tmp.X = this.paper.Left + i * (this.paper.ModelWidth + this.paper.HorizontalIntervalDistance);
tmp.Y = this.paper.Top + j * (this.paper.ModelHeight + this.paper.VerticalIntervalDistance);
tmp.Width = this.paper.ModelWidth;
tmp.Height = this.paper.ModelHeight;
tmp.PenColor = Color.Black;
tmp.PenWidth = 1;
tmp.IsFill = true;
tmp.FillColor = Color.AliceBlue;
shapes.lstShapes.Add(tmp);
}
}
// 这里做一个放大
shapes.zoomTo(e.Graphics.DpiX, e.Graphics.DpiY, this.pictureBox1.Width, this.pictureBox1.Height, 5);
// 显示
shapes.Draw(e.Graphics, shapes.GetMatrix(), false);
}
catch (Exception)
{
//throw;
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Paper
{
/// <summary>
/// 取得纸张设置的接口
/// </summary>
interface IPaperSetting
{
/// <summary>
/// 取得纸张的信息
/// </summary>
/// <returns></returns>
Paper GetPaper();
}
}

View File

@@ -0,0 +1,124 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Paper
{
/// <summary>
/// 纸张尺寸的
/// </summary>
public class Paper
{
/// <summary>
/// 纸张宽度
/// </summary>
[DescriptionAttribute("纸张宽度"), DisplayName("纸张宽度"), CategoryAttribute("纸张")]
public float PaperWidth { get; set; }
/// <summary>
/// 纸张高度
/// </summary>
[DescriptionAttribute("纸张高度"), DisplayName("纸张高度"), CategoryAttribute("纸张")]
public float PaperHeight { get; set; }
/// <summary>
/// 上边距
/// </summary>
[DescriptionAttribute("上边距"), DisplayName("上边距"), CategoryAttribute("边距")]
public float Top { get; set; }
/// <summary>
/// 左边距
/// </summary>
[DescriptionAttribute("左边距"), DisplayName("左边距"), CategoryAttribute("边距")]
public float Left { get; set; }
/// <summary>
/// 右边距
/// </summary>
[DescriptionAttribute("右边距"), DisplayName("右边距"), CategoryAttribute("边距")]
public float Right { get; set; }
/// <summary>
/// 下边距
/// </summary>
[DescriptionAttribute("下边距"), DisplayName("下边距"), CategoryAttribute("边距")]
public float Bottom { get; set; }
/// <summary>
/// 行数
/// </summary>
[DescriptionAttribute("一张纸上的模板的行数"), DisplayName("行数"), CategoryAttribute("模板")]
public int Rows { get; set; }
/// <summary>
/// 列数
/// </summary>
[DescriptionAttribute("一张纸上的模板的列数"), DisplayName("列数"), CategoryAttribute("模板")]
public int Cols { get; set; }
/// <summary>
/// 水平间隔
/// </summary>
[DescriptionAttribute("模板之间的水平间隔"), DisplayName("水平间隔"), CategoryAttribute("模板")]
public float HorizontalIntervalDistance { get; set; }
/// <summary>
/// 竖直间隔
/// </summary>
[DescriptionAttribute("模板之间的竖直间隔"), DisplayName("竖直间隔"), CategoryAttribute("模板")]
public float VerticalIntervalDistance { get; set; }
/// <summary>
/// 模板宽度
/// </summary>
[DescriptionAttribute("模板之间的模板宽度"), DisplayName("模板宽度"), CategoryAttribute("模板")]
public float ModelWidth { get; set; }
/// <summary>
/// 模板高度
/// </summary>
[DescriptionAttribute("模板之间的模板高度"), DisplayName("模板高度"), CategoryAttribute("模板")]
public float ModelHeight { get; set; }
/// <summary>
/// 横向打印
/// </summary>
[DescriptionAttribute("如果页面应横向打印,则为 true反之则为 false。 默认值由打印机决定。"), DisplayName("横向打印"), CategoryAttribute("打印机")]
public bool Landscape { get; set; }
/// <summary>
/// 横向方向的角度
/// </summary>
[DescriptionAttribute("有效的旋转值为 90 度和 270 度。 如果不支持横向,则唯一有效的旋转值为 0 度"), DisplayName("横向方向的角度"), CategoryAttribute("打印机")]
public int LandscapeAngle { get; set; }
/// <summary>
/// 模板的形状
/// </summary>
[Browsable(false)]//不在PropertyGrid上显示
public ShapeEle ModelShape;
//public void createModelShape()
//{
// // 这个是生成一个特殊的
// ModelShape = new ShapeRectangle()
// {
// X = 0,
// Y = 0,
// Width = ModelWidth,
// Height = ModelHeight,
// IsFill = true, // 填充
// FillColor = Color.White, // 填充白色。
// };
//}
public Paper()
{
//createModelShape(); // 默认创建一个空白的。
}
}
}

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core
{
/// <summary>
/// 这个是虚拟坐标跟画布上的坐标转换的
/// Offset 是偏移而Zoom是放大倍数
/// </summary>
public class PointTransform
{
public float OffsetX { get; set; }
public float OffsetY { get; set; }
private float _zoom=1; // 默认值1
public float Zoom
{
get { return _zoom; }
set { _zoom= value; if (value <= 0) _zoom = 1; } // 如果小于等于0就用默认值1吧。
}
/// <summary>
/// 这个转成画布的坐标
/// </summary>
/// <param name="pointF"></param>
/// <returns></returns>
public PointF CanvasToVirtualPoint(PointF pointF)
{
return new PointF() {
X = (pointF.X - OffsetX) / Zoom , // 这个是加偏移
Y = (pointF.Y - OffsetY) / Zoom
};
}
/// <summary>
/// 这个转成虚拟的坐标
/// </summary>
/// <param name="pointF"></param>
/// <returns></returns>
public PointF VirtualToCanvasPoint(PointF pointF)
{
return new PointF()
{
X = OffsetX + pointF.X * Zoom ,
Y = OffsetY + pointF.Y * Zoom
};
}
public Matrix GetMatrix()
{
Matrix matrix = new Matrix();
matrix.Translate(OffsetX, OffsetY);
matrix.Scale(Zoom, Zoom);
return matrix;
}
/// <summary>
/// 像素转成毫米
/// </summary>
/// <param name="g"></param>
/// <param name="pointF"></param>
/// <returns></returns>
public static PointF pixToMM(float dpiX, float dpiY, PointF pointF)
{
return new PointF(pointF.X/ dpiX * 25.4f,pointF.Y/ dpiY * 25.4f);
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Print
{
public abstract class AbstractPrintItemFactory : IPrintItemFactory
{
/// <summary>
/// 用这个来保存PrintItem
/// </summary>
protected Dictionary<string, PrintItem> dict_printItem = new Dictionary<string, PrintItem>();
public PrintItem GetPrintItem(string name)
{
if (dict_printItem.ContainsKey(name))
{
return dict_printItem[name];
}
return null;
//throw new NotImplementedException();
}
/// <summary>
/// 删除,受到保护的,外部不能随便调用的。
/// </summary>
/// <param name="name"></param>
protected void deletePrintItem(string name)
{
dict_printItem.Remove(name);
//throw new NotImplementedException();
}
/// <summary>
/// 外部不能随便的增加
/// </summary>
/// <param name="name"></param>
/// <param name="printItem"></param>
protected void registerPrintItem(string name, PrintItem printItem)
{
if (! dict_printItem.ContainsKey(name))
{
// 没有才添加
dict_printItem[name] = printItem;
}
//throw new NotImplementedException();
}
public string registerPrintItem(PrintItem printItem)
{
string id = getNoRepeatId(); // 先取得一个不重复的id
registerPrintItem(id, printItem); // 注册
return id; // 返回这个id
}
public abstract string getNoRepeatId();
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Print
{
/// <summary>
/// 这个是取得PrintItem
/// </summary>
interface IPrintItemFactory
{
/// <summary>
/// 根据名字取得PrintItem
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
PrintItem GetPrintItem(string name);
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Print
{
/// <summary>
/// 打印管理者
/// </summary>
interface IPrintManager
{
/// <summary>
/// 添加一个新的打印
/// </summary>
/// <param name="printItem"></param>
void addPrintItem(PrintItem printItem);
}
}

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/**
* 外部往里边传入这个变量,
* 内部把这个拆分成一张纸比如一张纸上有10个模板那么就10个变量集合不用打印数量,打印机了。
*
* */
namespace Io.Github.Kerwinxu.LibShapes.Core.Print
{
/// <summary>
/// 打印项目
/// </summary>
public class PrintItem
{
/// <summary>
/// 打印机名称
/// </summary>
public string PrinterName { get; set; }
/// <summary>
/// 图形
/// </summary>
public Shapes Shapes { get; set; }
/// <summary>
/// 变量的集合
/// </summary>
public List<Dictionary<string, string>> Valss { get; set; }
/// <summary>
/// 打印数量
/// </summary>
public List<int> PrintCounts { get; set; }
/// <summary>
/// 是否充满打印,
/// </summary>
public bool isFullPrint { get; set; }
/// <summary>
/// 构造函数
/// </summary>
public PrintItem()
{
// 初始化变量
Valss = new List<Dictionary<string, string>>();
PrintCounts = new List<int>();
}
}
}

View File

@@ -0,0 +1,239 @@
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Print
{
/// <summary>
/// 打印管理者的实现
/// </summary>
public class PrintManagerImpl : AbstractPrintItemFactory, IPrintManager
{
/// <summary>
/// 打印的时候需要的id区分不同的打印的。
/// </summary>
private int _id = 0;
public void addPrintItem(PrintItem printItem)
{
// 这里收到一个打印的部分,然后需要拆分,
// 思路是,首先区分是否充满,充满的话,就是按照整数去打印,而不充满的,是要填充的。
if (printItem.Valss.Count != printItem.PrintCounts.Count) throw new SizeNotEqual();
// 判断是否是充满打印,由具体的函数去负责处理。
if (printItem.isFullPrint)
{
addPrintItemFullPrint(printItem);
}
else
{
addPrintItemNotFullPrint(printItem);
}
//throw new NotImplementedException();
}
/// <summary>
/// 不是充满的打印。
/// </summary>
/// <param name="printItem"></param>
protected void addPrintItemNotFullPrint(PrintItem printItem)
{
// 如下的提取出来是方便减少代码的。
int rows = printItem.Shapes.Paper.Rows;
int cols = printItem.Shapes.Paper.Cols;
// 一个临时的打印变量。
PrintItem printItem_tmp = new PrintItem();
printItem_tmp.PrinterName = printItem.PrinterName;
printItem_tmp.Shapes = printItem.Shapes;
// 循环条件是还有要打印的。
while (printItem.Valss.Count > 0)
{
// 判断前面的是否为空,为空表示下边的这个可以一次性打印几张。
if (printItem_tmp.Valss.Count == 0)
{
// 判断是否判断是否大于一张
if (printItem.PrintCounts.First() >= rows* cols)
{
// 填充指定数量的变量
for (int i = 0; i < rows*cols; i++)
{
printItem_tmp.Valss.Add(printItem.Valss.First());
}
int num = printItem.PrintCounts.First() / (rows * cols);// 取整
printItem.PrintCounts[0] -= num * rows * cols; // 减去指定的数量
sendToPrinter(printItem_tmp, num); // 发送给打印机
printItem_tmp = new PrintItem(); // 重新
printItem_tmp.PrinterName = printItem.PrinterName;
printItem_tmp.Shapes = printItem.Shapes;
}
else
{
// 这里表示不够一页啊
for (int i = 0; i < printItem.PrintCounts.First(); i++)
{
printItem_tmp.Valss.Add(printItem.Valss.First());
}
// 添加上去
printItem.PrintCounts[0] = 0;
}
}
else
{
// 添加指定的多个。这里表示这次打印的数量是1张。
// 这里判断是否够一张
if (printItem.PrintCounts.First() + printItem_tmp.Valss.Count >= rows * cols)
{
// 看看还却多少。
int i_max = rows * cols - printItem_tmp.Valss.Count;
for (int i = 0; i < i_max; i++)
{
printItem.Valss.Add(printItem.Valss.First());
}
// 减去指定的多少。
printItem.PrintCounts[0] -= i_max; // 减去指定的数量
sendToPrinter(printItem_tmp, 1); // 发送给打印机
printItem_tmp = new PrintItem(); // 重新
printItem_tmp.PrinterName = printItem.PrinterName;
printItem_tmp.Shapes = printItem.Shapes;
}
else
{
for (int i = 0; i < printItem.PrintCounts.First(); i++)
{
printItem_tmp.Valss.Add(printItem.Valss.First());
}
printItem.PrintCounts[0] = 0;// 不够减,看看下一个把。
}
}
// 这里删除空白的
while (printItem.PrintCounts.Count > 0 && printItem.PrintCounts.First() == 0)
{
// 删除第一个。
printItem.Valss.RemoveAt(0);
printItem.PrintCounts.RemoveAt(0);
}
}
// 如果还有数据,就打印吧
if (printItem_tmp.Valss.Count != 0)
{
sendToPrinter(printItem_tmp, 1); // 发送给打印机
}
}
/// <summary>
/// 充满的打印。
/// </summary>
/// <param name="printItem"></param>
protected void addPrintItemFullPrint(PrintItem printItem)
{
// 如下的提取出来是方便减少代码的。
int rows = printItem.Shapes.Paper.Rows;
int cols = printItem.Shapes.Paper.Cols;
// 每一个都是充满打印。
for (int i = 0; i < printItem.Valss.Count; i++)
{
PrintItem printItem_tmp = new PrintItem(); //
printItem_tmp.PrinterName = printItem.PrinterName; // 打印机
printItem_tmp.Shapes = printItem.Shapes;
for (int j = 0; j < rows * cols; j++)
{
printItem_tmp.Valss.Add(printItem.Valss[i]); // 添加多次就是啦。
}
// 这里计算打印的数量
int num = (int)((printItem.PrintCounts[i] + 0.5) / (rows + cols));
// 发送给打印机
sendToPrinter(printItem_tmp, num);
}
}
/// <summary>
/// 发送给打印机
/// </summary>
/// <param name="printItem"></param>
/// <param name="printnum"></param>
protected void sendToPrinter(PrintItem printItem, int printnum)
{
// 这里真正的发给打印机
PrintDocument printDocument = new PrintDocument();
printDocument.PrinterSettings.PrinterName = printItem.PrinterName; // 设置打印机
printDocument.PrinterSettings.Copies = (short)printnum; // 设置打印数量
printDocument.PrintController = new StandardPrintController(); //
printDocument.OriginAtMargins = false; // 如果图形起始于页面边距,则为 true如果图形原点位于该页可打印区域的左上角则为 false。 默认值为 false。
printDocument.DefaultPageSettings.PaperSize = new PaperSize(
"custom",
(int)(printItem.Shapes.Paper.PaperWidth / 10 / 2.54 * 100),
(int)(printItem.Shapes.Paper.PaperHeight / 10 / 2.54 * 100)
);
//printDocument.DefaultPageSettings.Landscape = printItem.Shapes.Paper.Landscape; // 横向打印
// 然后设置打印的id
string id = registerPrintItem(printItem);
printDocument.DocumentName = id; // 这个id跟printItem是存在一一对应关系的
printDocument.PrintPage += PrintDocument_PrintPage; // 打印事件处理
printDocument.Print(); // 打印。
printDocument.Dispose();
}
private void PrintDocument_PrintPage(object sender, PrintPageEventArgs e)
{
// 这里真正的打印,首先取得打印的数据
PrintDocument printDocument = sender as PrintDocument;
// 这里取得打印的数据了
PrintItem printItem = GetPrintItem(printDocument.DocumentName);
// 先提取出数据
int rows = printItem.Shapes.Paper.Rows;
int cols = printItem.Shapes.Paper.Cols;
float top = printItem.Shapes.Paper.Top;
float left = printItem.Shapes.Paper.Left;
float modelWidth = printItem.Shapes.Paper.ModelWidth;
float modelHeight = printItem.Shapes.Paper.ModelHeight;
float hor = printItem.Shapes.Paper.HorizontalIntervalDistance;// 模板的水平间隔
float ver = printItem.Shapes.Paper.VerticalIntervalDistance; // 模板的垂直间隔
var valsss = printItem.Valss; // 变量集合。
var shapes = printItem.Shapes; // 形状
// 循环打印
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
// 更改变量
// 这里要判断一下是否超过索引
if (i * rows + j >= printItem.Valss.Count) break;
shapes.Vars = valsss[i * rows + j];
// 然后计算偏移
Matrix matrix = new Matrix();
matrix.Translate(
left + j * (modelWidth + hor),
top + i * (modelHeight + ver)
);
// 绘图
shapes.Draw(e.Graphics, matrix, false);
}
}
//throw new NotImplementedException();
}
public override string getNoRepeatId()
{
return (++_id).ToString();// 假设打印的部分很小,足够了把。
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Print
{
/// <summary>
/// 尺寸不相等的异常
/// </summary>
public class SizeNotEqual :Exception
{
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core
{
/// <summary>
/// 选择策略,主要是两种,
/// </summary>
public class SelectStrategy
{
/// <summary>
/// 靠近在这个范围内就算选择了。
/// </summary>
private static float tolerance = 0.5f;
/// <summary>
/// 两个点是否距离足够近
/// </summary>
/// <param name="p1"></param>
/// <param name="p2"></param>
/// <returns></returns>
public static bool isNear(PointF p1, PointF p2)
{
return Utils.DistanceCalculation.distance(p1, p2) <= tolerance;
}
/// <summary>
/// 一个点跟一个线段是否靠的非常近。
/// </summary>
/// <param name="p0"></param>
/// <param name="p1"></param>
/// <param name="p2"></param>
/// <returns></returns>
public static bool isNear(PointF p0, PointF p1, PointF p2)
{
return Utils.DistanceCalculation.pointToLine(p0, p1, p2) <= tolerance;
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Serialize
{
public abstract class AbstractSerialize : ISerialize
{
// 实现了如下的两个方法。
public void SerializeObjectToFile(object obj, string file_path)
{
System.IO.File.WriteAllText(file_path, SerializeObject(obj));
}
public T DeserializeObjectFromFile<T>(string file_path)
{
return DeserializeObject<T>(System.IO.File.ReadAllText(file_path));
}
// 如下的等待具体的类去实现。
public abstract T DeserializeObject<T>(string value);
public abstract string SerializeObject(object obj);
}
}

View File

@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Serialize
{
/// <summary>
/// 序列化接口
/// </summary>
public interface ISerialize
{
/// <summary>
/// 序列化
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
string SerializeObject(Object obj);
/// <summary>
/// 反序列化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
/// <returns></returns>
T DeserializeObject<T>(string value);
// 这里表示从文件中序列化和反序列化
/// <summary>
/// 序列化到文件
/// </summary>
/// <param name="obj"></param>
/// <param name="file_path"></param>
void SerializeObjectToFile(Object obj, string file_path);
T DeserializeObjectFromFile<T>(string file_path);
}
}

View File

@@ -0,0 +1,41 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Serialize
{
/// <summary>
/// json的序列化
/// </summary>
public class JsonSerialize : AbstractSerialize
{
public override T DeserializeObject<T>(string value)
{
return JsonConvert.DeserializeObject<T>(value,jsonSerializerSettings);
//throw new NotImplementedException();
}
public override string SerializeObject(object obj)
{
return JsonConvert.SerializeObject(obj, Formatting.Indented, jsonSerializerSettings);
//throw new NotImplementedException();
}
/// <summary>
/// 有这个是确保反序列化到正确的类型。
/// </summary>
private JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings()
{
TypeNameHandling = TypeNameHandling.Auto, // 自动的All的话会有问题。
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat,
DateFormatString = "yyyy-MM-dd HH:mm:ss", //空值处理
//NullValueHandling = NullValueHandling.Ignore, //高级用法九中的`Bool`类型转换设置
ReferenceLoopHandling = ReferenceLoopHandling.Serialize, // 循环引用的的解决方式,如下如下两种设置。
PreserveReferencesHandling = PreserveReferencesHandling.Objects, //
Formatting = Formatting.Indented, // 缩进的
};
}
}

View File

@@ -0,0 +1,207 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 枚举转换器
/// 用此类之前必须保证在枚举项中定义了Description
/// </summary>
public class EnumConverter : ExpandableObjectConverter
{
/// <summary>
/// 枚举项集合
/// </summary>
Dictionary<object, string> dic;
/// <summary>
/// 构造函数
/// </summary>
public EnumConverter()
{
dic = new Dictionary<object, string>();
}
/// <summary>
/// 加载枚举项集合
/// </summary>
/// <param name="context"></param>
private void LoadDic(ITypeDescriptorContext context)
{
dic = GetEnumValueDesDic(context.PropertyDescriptor.PropertyType);
}
/// <summary>
/// 是否可从来源转换
/// </summary>
/// <param name="context"></param>
/// <param name="sourceType"></param>
/// <returns></returns>
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
return true;
return base.CanConvertFrom(context, sourceType);
}
/// <summary>
/// 从来源转换
/// </summary>
/// <param name="context"></param>
/// <param name="culture"></param>
/// <param name="value"></param>
/// <returns></returns>
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value is string)
{
//如果是枚举
if (context.PropertyDescriptor.PropertyType.IsEnum)
{
if (dic.Count <= 0)
LoadDic(context);
if (dic.Values.Contains(value.ToString()))
{
foreach (object obj in dic.Keys)
{
if (dic[obj] == value.ToString())
{
return obj;
}
}
}
}
}
return base.ConvertFrom(context, culture, value);
}
/// <summary>
/// 是否可转换
/// </summary>
/// <param name="context"></param>
/// <param name="destinationType"></param>
/// <returns></returns>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return true;
}
/// <summary>
///
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
/// <summary>
///
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true;
}
/// <summary>
///
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
//ListAttribute listAttribute = (ListAttribute)context.PropertyDescriptor.Attributes[typeof(ListAttribute)];
//StandardValuesCollection vals = new TypeConverter.StandardValuesCollection(listAttribute._lst);
//Dictionary<object, string> dic = GetEnumValueDesDic(typeof(PKGenerator));
//StandardValuesCollection vals = new TypeConverter.StandardValuesCollection(dic.Keys);
if (dic == null || dic.Count <= 0)
LoadDic(context);
StandardValuesCollection vals = new TypeConverter.StandardValuesCollection(dic.Keys);
return vals;
}
/// <summary>
///
/// </summary>
/// <param name="context"></param>
/// <param name="culture"></param>
/// <param name="value"></param>
/// <param name="destinationType"></param>
/// <returns></returns>
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
//DescriptionAttribute.GetCustomAttribute(
//EnumDescription
//List<KeyValuePair<Enum, string>> mList = UserCombox.ToListForBind(value.GetType());
//foreach (KeyValuePair<Enum, string> mItem in mList)
//{
// if (mItem.Key.Equals(value))
// {
// return mItem.Value;
// }
//}
//return "Error!";
//绑定控件
// FieldInfo fieldinfo = value.GetType().GetField(value.ToString());
//Object[] objs = fieldinfo.GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false);
//if (objs == null || objs.Length == 0)
//{
// return value.ToString();
//}
//else
//{
// System.ComponentModel.DescriptionAttribute da = (System.ComponentModel.DescriptionAttribute)objs[0];
// return da.Description;
//}
if (dic.Count <= 0)
LoadDic(context);
foreach (object key in dic.Keys)
{
if (key.ToString() == value.ToString() || dic[key] == value.ToString())
{
return dic[key].ToString();
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
/// <summary>
/// 记载枚举的值+描述
/// </summary>
/// <param name="enumType"></param>
/// <returns></returns>
public Dictionary<object, string> GetEnumValueDesDic(Type enumType)
{
Dictionary<object, string> dic = new Dictionary<object, string>();
FieldInfo[] fieldinfos = enumType.GetFields();
foreach (FieldInfo field in fieldinfos)
{
if (field.FieldType.IsEnum)
{
Object[] objs = field.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (objs.Length > 0)
{
dic.Add(Enum.Parse(enumType, field.Name), ((DescriptionAttribute)objs[0]).Description);
}
}
}
return dic;
}
}
}

View File

@@ -0,0 +1,78 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 椭圆弧
/// </summary>
public class ShapeArc : ShapeRectangle
{
public ShapeArc()
{
// 设置默认的角度
StartAngle = 0;
SweepAngle = 90;
}
[DescriptionAttribute("弧线的起始角度"), DisplayName("弧线的起始角度"), CategoryAttribute("外观")]
public float StartAngle { get; set; }
[DescriptionAttribute("startAngle 和弧线末尾之间的角度"), DisplayName("夹角"), CategoryAttribute("外观")]
public float SweepAngle { get; set; }
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeArc>(json);
//throw new NotImplementedException();
}
public override System.Drawing.RectangleF GetBounds(Matrix matrix)
{
// 这个实际上是矩形的
GraphicsPath path = base.GetGraphicsPathWithAngle();
// 这里加上旋转
Matrix matrix1 = new Matrix();
// 这里按照中心点旋转,
var rect = path.GetBounds();
var centerPoint = new PointF() { X = rect.X + rect.Width / 2, Y = rect.Y + rect.Height / 2 };
matrix1.RotateAt(Angle, centerPoint);
Matrix matrix2 = matrix.Clone();
matrix2.Multiply(matrix1);
// 应用这个转换
path.Transform(matrix2);
return path.GetBounds();
//return base.GetBounds(matrix);
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
GraphicsPath path = new GraphicsPath();
var rect = new System.Drawing.RectangleF()
{
X = getX(),
Y = getY(),
Width = getWidth(),
Height = getHeight(),
};
var rect2 = correctRectangle(rect);
path.AddArc(
rect2,
StartAngle,
SweepAngle);
return path;
//return base.GetGraphicsPathWithAngle();
}
}
}

View File

@@ -0,0 +1,162 @@
using Io.Github.Kerwinxu.LibShapes.Core.Converter;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using ZXing;
using ZXing.Common;
using ZXing.QrCode;
using ZXing.QrCode.Internal;
using ZXing.Rendering;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
public class ShapeBarcode : ShapeVar
{
/// <summary>
/// 构造函数
/// </summary>
public ShapeBarcode()
{
QrCodeErrorLevel = "容错7%"; // 默认这个
Encoding = "CODE_39"; // 默认编码
StaticText = "690123456789"; // 默认数字
isIncludeLabel = true; // 默认包含标签。
IsFill = true;
Font = new Font("Arial", 8); // 默认的字体
}
#region
/// <summary>
/// qr二维码的容错率
/// </summary>
[TypeConverter(typeof(QrCodeErrorCorrectionLevelConverter)), DescriptionAttribute("QR Code编码的容错率"), DisplayName("QR Code容错率"), CategoryAttribute("条形码设置")]
public string QrCodeErrorLevel { get; set; }
/// <summary>
/// 编码类型
/// </summary>
[TypeConverter(typeof(BarcodeEncodingConverter)), DescriptionAttribute("编码"), DisplayName("编码"), CategoryAttribute("条形码设置")]
public string Encoding { get; set; }
/// <summary>
/// 字体
/// </summary>
[DescriptionAttribute("请注意,这个字体是打印机上实际的字体,在界面上不会放大缩小。"), DisplayName("字体"), CategoryAttribute("字体")]
public Font Font { get; set; }
[DescriptionAttribute("是否包含标签"), DisplayName("包含标签"), CategoryAttribute("条形码设置")]
public bool isIncludeLabel { get; set; }
#endregion
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeBarcode>(json);
//throw new NotImplementedException();
}
public override void Draw(Graphics g, Matrix matrix)
{
// 请注意,我这个算法是有瑕疵的,
// 这个角度实际上应该是最小内接矩形的角度,
// 这个是个小项目,应用场景是简单的图形操作,
// 如果群组里套图形加上群组有角度,会产生偏差。
// 1.0首先取得没有变换前的坐标
var path = GetGraphicsPath(matrix);
var rect = path.GetBounds(); // 外接矩形,如果是内接矩形是最准的。
// 这里需要将尺寸单位更改一下我的画布是mm而这个zxing估计是像素吧
var rect2 = new Rectangle()
{
//X = (int)(rect.X / 25.4 * g.DpiX),
//Y = (int)(rect.Y / 25.4 * g.DpiY),
Width = (int)(rect.Width / 25.4 * g.DpiX),
Height = (int)(rect.Height / 25.4 * g.DpiX),
};
// 我这里改成一开始就是1比1
// 中心点的坐标
var centerPoint = new PointF()
{
X = rect.X + rect.Width / 2,
Y = rect.Y + rect.Height / 2
};
// 2. 取得条形码图像
BarcodeWriter writer = new BarcodeWriter() {
Renderer = new BitmapRenderer() {
DpiX = g.DpiX,
DpiY = g.DpiY,
TextFont = this.Font,
}
};
writer.Format = BarcodeEncodingConverter.dictBarcode[Encoding]; // 编码
EncodingOptions options = new EncodingOptions()
{
Width = rect2.Width, // 图像的宽和高
Height = rect2.Height,
PureBarcode = !isIncludeLabel, // 是否包括标签。
Margin = 2,
};
if (Encoding == "QR_CODE")
{
options = new QrCodeEncodingOptions() {
Width = (int)rect2.Width, // 图像的宽和高
Height = (int)rect2.Height,
PureBarcode = !isIncludeLabel, // 是否包括标签。
Margin = 2,
ErrorCorrection=QrCodeErrorCorrectionLevelConverter.level[QrCodeErrorLevel],
};
}
writer.Options = options;
var text = getText();
if (string.IsNullOrEmpty(text))
{
// 如果没有,就话一个矩形吧。就什么都不做。
}
else
{
var bitmap = writer.Write(text); // 生成条形码图像。
if (bitmap != null)
{
// 3. 转换。
Matrix matrix1 = new Matrix();
matrix1.RotateAt(this.Angle, centerPoint);
g.Transform = matrix1; // 应用这个变换。
// 4.
g.DrawImage(bitmap, rect.X, rect.Y, rect.Width, rect.Height);
//5.
g.ResetTransform(); // 取消这个变换
}
}
//base.Draw(g, matrix);
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
// 这个直接是返回父类的,
return base.GetGraphicsPathWithAngle();
}
}
}

View File

@@ -0,0 +1,357 @@
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 形状的基类
/// </summary>
public abstract class ShapeEle
{
/// <summary>
/// 构造函数
/// </summary>
public ShapeEle()
{
// 提供一些默认的参数
PenWidth = 1;
PenColor = Color.Black;
}
#region
#region
/// <summary>
/// 唯一的标识符
/// </summary>
[CategoryAttribute("设计")]
public int ID { get; set; }
#endregion
#region
[CategoryAttribute("布局")]
public float X { get; set; }
[CategoryAttribute("布局")]
public float Y { get; set; }
[DescriptionAttribute("宽度"), DisplayName("宽度"), CategoryAttribute("布局")]
public float Width { get; set; }
[DescriptionAttribute("高度"), DisplayName("高度"), CategoryAttribute("布局")]
public float Height { get; set; }
[DescriptionAttribute("角度"), DisplayName("角度"), CategoryAttribute("外观")]
public float Angle { get; set; }
#endregion
#region
[DescriptionAttribute("边框颜色"), DisplayName("边框颜色"), CategoryAttribute("外观")]
public Color PenColor { get; set; }
[DescriptionAttribute("边框粗细"), DisplayName("边框粗细"), CategoryAttribute("外观")]
public float PenWidth { get; set; }
[DescriptionAttribute("虚线的样式"), DisplayName("虚线的样式"), CategoryAttribute("外观")]
public DashStyle PenDashStyle { get; set; }
[DescriptionAttribute("是否填充"), DisplayName("是否填充"), CategoryAttribute("外观")]
public bool IsFill { get; set; }
[DescriptionAttribute("填充颜色"), DisplayName("填充颜色"), CategoryAttribute("外观")]
public Color FillColor { get; set; }
#region
float x_add, y_add, width_add, height_add;
#endregion
#endregion
#endregion
#region
public virtual void Draw(Graphics g, Matrix matrix) {
// 首先取得绘图路径
try
{
var path = GetGraphicsPath(matrix);
// 定义画笔
Pen pen = new Pen(PenColor);
pen.Width = PenWidth; // 画笔的粗细
pen.DashStyle = PenDashStyle; // 虚线的样式
g.DrawPath(pen, path); // 画边框
if (IsFill) // 如果填充
{
Brush brush = new SolidBrush(FillColor);
g.FillPath(brush, path);
}
path.Dispose();
}
catch (Exception ex)
{
//throw;
}
}
/// <summary>
/// 这个返回的是屏幕画布上的真实的坐标体系
/// </summary>
/// <param name="matrix"></param>
/// <returns></returns>
public virtual GraphicsPath GetGraphicsPath(Matrix matrix)
{
GraphicsPath path = null;
if (getWidth() == 0 || getHeight() == 0)
{
// 这里表示只是一条线段或者一个点了
path = new GraphicsPath();
path.AddLine(new PointF(getX(), getY()), new PointF(getX() + getWidth(), getY() + getHeight()));
}
else
{
path = GetGraphicsPathWithAngle();
}
// 这里加上旋转
Matrix matrix1 = new Matrix();
// 这里按照中心点旋转,
var rect = path.GetBounds();
var centerPoint = new PointF() { X = rect.X + rect.Width / 2, Y = rect.Y + rect.Height / 2 };
matrix1.RotateAt(Angle, centerPoint);
Matrix matrix2 = matrix.Clone();
matrix2.Multiply(matrix1);
// 应用这个转换
path.Transform(matrix2);
// 返回这个路径
return path;
}
/// <summary>
/// 矫正矩形,宽和高都不能是复数
/// </summary>
/// <param name="rect"></param>
/// <returns></returns>
protected RectangleF correctRectangle(RectangleF rect)
{
RectangleF rect2 = new RectangleF() {
X = rect.X,
Y = rect.Y,
Width = rect.Width,
Height = rect.Height,
};
if (rect2.Width < 0)
{
rect2.X += rect2.Width;
rect2.Width = -rect2.Width;
}
if (rect2.Height < 0)
{
rect2.Y += rect2.Height;
rect2.Height = -rect2.Height;
}
return rect2;
}
/// <summary>
/// 返回不包括旋转的路径,且这个是虚拟世界的坐标,不用考虑画布中实际的坐标。
/// </summary>
/// <returns></returns>
public virtual GraphicsPath GetGraphicsPathWithAngle()
{
GraphicsPath path = new GraphicsPath();
var rect = new System.Drawing.RectangleF()
{
X = getX(),
Y = getY(),
Width = getWidth(),
Height = getHeight()
};
var rect2 = correctRectangle(rect);
path.AddRectangle(rect2);
return path;
}
/// <summary>
/// 返回外接矩形
/// </summary>
/// <returns></returns>
public virtual RectangleF GetBounds(Matrix matrix)
{
// 请注意,这里是以旋转后的。
return GetGraphicsPath(matrix).GetBounds();
}
/// <summary>
/// 选择的容忍度
/// </summary>
private Pen pen_select_tolerance = new Pen(Color.White) {
Width = DistanceCalculation.select_tolerance
};
/// <summary>
/// 这个点是否在这个图形的轮廓上
/// </summary>
/// <param name="mousePointF"></param>
/// <returns></returns>
public virtual bool isOutlineVisible(Matrix matrix, PointF mousePointF)
{
var pen = new Pen(new SolidBrush(this.PenColor), this.PenWidth);
return GetGraphicsPath(matrix).IsOutlineVisible(mousePointF, pen);
//return GetGraphicsPath(matrix).IsVisible(mousePointF);
}
/// <summary>
/// 这个点是否在这个图形的的内部
/// </summary>
/// <param name="mousePointF"></param>
/// <returns></returns>
public virtual bool isVisible(Matrix matrix, PointF mousePointF)
{
return GetGraphicsPath(matrix).IsVisible(mousePointF);
//return GetGraphicsPath(matrix).IsVisible(mousePointF);
}
/// <summary>
/// 这个表示是否被包含在这个矩形内
/// </summary>
/// <param name="rect"></param>
/// <returns></returns>
public virtual bool isBeContains(Matrix matrix, RectangleF rect)
{
var rect2 = GetBounds(matrix);
return rect.Contains(rect2);
}
public virtual void setVals(Dictionary<string, string> vars)
{
// 什么都不做,子类如果需要,就自己实现。
}
/// <summary>
/// 根据这个矩形更改
/// </summary>
/// <param name="rect"></param>
public void Change(RectangleF rect)
{
x_add = rect.X;
y_add = rect.Y;
width_add = rect.Width;
height_add = rect.Height;
}
public virtual void ChangeComplated()
{
// 将更改固定下来
X += x_add;
Y += y_add;
Width += width_add;
Height += height_add;
// 清零
x_add = 0;
y_add = 0;
width_add = 0;
height_add = 0;
// 这里要注意矫正 todo
if (Width < 0)
{
X += Width;
Width = -Width;
}
if (Height < 0)
{
Y += Height;
Height = -Height;
}
}
/// <summary>
/// 深度拷贝
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public abstract ShapeEle DeepClone();
public override bool Equals(object obj)
{
// 首先判断是否是
var shape = obj as ShapeEle;
if (shape == null) return false; // 转换失败就是不同啦
return this.X == shape.X &&
this.Y == shape.Y &&
this.Width == shape.Width &&
this.Height == shape.Height &&
this.Angle == shape.Angle &&
this.ID == shape.ID &&
this.PenColor == shape.PenColor &&
this.PenWidth == shape.PenWidth &&
this.PenDashStyle == shape.PenDashStyle &&
this.IsFill == shape.IsFill &&
this.FillColor == shape.FillColor;
//return base.Equals(obj);
}
#region add后的参数
protected float getX()
{
return X + x_add;
}
protected float getY()
{
return Y + y_add;
}
protected float getWidth()
{
return Width + width_add;
}
protected float getHeight()
{
return Height + height_add;
}
#endregion
#endregion
public override int GetHashCode()
{
return ID * base.GetHashCode();
//return base.GetHashCode();
}
}
}

View File

@@ -0,0 +1,41 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 椭圆
/// </summary>
public class ShapeEllipse : ShapeEle
{
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeEllipse>(json);
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
GraphicsPath path = new GraphicsPath();
var rect = new System.Drawing.RectangleF()
{
X = getX(),
Y = getY(),
Width = getWidth(),
Height = getHeight()
};
var rect2 = correctRectangle(rect);
path.AddEllipse(rect2); // 跟矩形不同的是这里的是AddEllipse
return path;
//return base.GetGraphicsPathWithAngle();
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
public class ShapeGroup : ShapeMulti
{
/// <summary>
/// 这个重新是因为这个要真正的绘制而ShapeMultiSelect不需要ShapeMultiSelect里保存的只是多个形状的引用。
/// </summary>
/// <param name="g"></param>
/// <param name="matrix"></param>
public override void Draw(Graphics g, Matrix matrix)
{
// 这里首先要注意的是这个可以旋转的
Matrix matrix1 = matrix.Clone();
var rect = GetGraphicsPathWithAngle().GetBounds();
var centerPoint = new PointF() {
X = rect.X + rect.Width / 2,
Y = rect.Y + rect.Height / 2
};
matrix1.RotateAt(Angle, centerPoint);
foreach (var item in shapes)
{
item.Draw(g, matrix1);
}
}
/// <summary>
/// 这个其实是取得了含有角度的。
/// </summary>
/// <returns></returns>
public override GraphicsPath GetGraphicsPathWithAngle()
{
// 这个不需要返回什么。
return null;
}
public override ShapeEle DeepClone()
{
// 首先组建一个新的
ShapeGroup group = new ShapeGroup();
if (shapes != null)
{
foreach (var item in shapes)
{
group.shapes.Add(item.DeepClone());
}
}
return group;
//throw new NotImplementedException();
}
public override bool Equals(object obj)
{
var shape = obj as ShapeGroup;
if (shape == null) return false; // 转换失败就是不同啦
// 群组,需要判断每一个是否相同。
if (shapes.Count != shape.shapes.Count) return false;
for (int i = 0; i < shapes.Count; i++)
{
if (shapes[i] != shape.shapes[i])
{
return false;
}
}
return true;
//return base.Equals(obj);
}
public override int GetHashCode()
{
return this.ID;
return base.GetHashCode();
}
}
}

View File

@@ -0,0 +1,155 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 图片
/// </summary>
public class ShapeImage : ShapeVar
{
public ShapeImage()
{
IsFill = true; // 这样可以方便的选择。
}
// 这个不用ShapeVar中的StaticText是因为我不想显示并且也不用GetText是因为这个默认情况下变量意味着路径而Img意味着静态的图片。
[Browsable(false)]//不在PropertyGrid上显示
public string Img { get; set; }
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeImage>(json);
}
public override void Draw(Graphics g, Matrix matrix)
{
// 请注意,我这个算法是有瑕疵的,
// 这个角度实际上应该是最小内接矩形的角度,
// 这个是个小项目,应用场景是简单的图形操作,
// 如果群组里套图形加上群组有角度,会产生偏差。
// 1.0首先取得没有变换前的坐标
var path = GetGraphicsPath(matrix);
var rect = path.GetBounds(); // 外接矩形,如果是内接矩形是最准的。
var centerPoint = new PointF() // 中心点的坐标
{
X = rect.X + rect.Width/2,
Y= rect.Y + rect.Height/2
};
// 2. 取得图片对象
var bitmap = getImg();
if (bitmap != null)
{
// 3. 转换。
Matrix matrix1 = new Matrix();
matrix1.RotateAt(this.Angle, centerPoint);
g.Transform = matrix1; // 应用这个变换。
// 4.
// todo 以后添加上拉伸的判断。
g.DrawImage(bitmap, rect.X, rect.Y, rect.Width, rect.Height);
//5.
g.ResetTransform(); // 取消这个变换
}
//base.Draw(g, matrix);
}
private Bitmap getImg()
{
try
{
if (string.IsNullOrEmpty(this.VarName))
{
return Base64StringToImage(this.Img);
}
else
{
// 这里表示是有路径
if (File.Exists(this.VarValue))
{
// 如果路径存在
return (Bitmap)Image.FromFile(this.VarValue);
}
return null;
}
}
catch (Exception)
{
//throw;
}
return null;
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
return base.GetGraphicsPathWithAngle();
}
#region
public static string ImgToBase64String(Bitmap bmp)
{
try
{
//如下是为了预防GDI一般性错误而深度复制
Bitmap bmp2 = new Bitmap(bmp);
MemoryStream ms = new MemoryStream();
bmp2.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] arr = new byte[ms.Length];
ms.Position = 0;
ms.Read(arr, 0, (int)ms.Length);
ms.Close();
String strbaser64 = Convert.ToBase64String(arr);
bmp2.Dispose();
return strbaser64;
}
catch (Exception ex)
{
return "";
}
}
//base64编码的文本 转为图片
public static Bitmap Base64StringToImage(string strbaser64)
{
try
{
byte[] arr = Convert.FromBase64String(strbaser64);
MemoryStream ms = new MemoryStream(arr);
Bitmap bmp = new Bitmap(ms);
ms.Close();
return bmp;
}
catch (Exception ex)
{
return new Bitmap(10, 10);
}
}
#endregion
}
}

View File

@@ -0,0 +1,50 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 线段
/// </summary>
public class ShapeLine : ShapeEle
{
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeLine>(json);
//throw new NotImplementedException();
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
GraphicsPath path = new GraphicsPath();
path.AddLine(getX(), getY(), getX()+getWidth(), getY()+getHeight());
return path;
//throw new NotImplementedException();
}
///// <summary>
///// 是否取得线段的。
///// </summary>
///// <param name="matrix"></param>
///// <param name="mousePointF"></param>
///// <returns></returns>
//public override bool isContains(Matrix matrix, PointF mousePointF)
//{
// // 这里用点到线段的距离来判断的,
// var path = GetGraphicsPath(matrix);// 取得路径
// var points = path.PathPoints; // 取得路径上的点
// bool b = SelectStrategy.isNear(mousePointF, points[0], points[1]);
// return b;
// //return base.isContains(matrix, mousePointF);
//}
}
}

View File

@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 多个形状的集合
/// </summary>
public class ShapeMulti:ShapeEle
{
public List<ShapeEle> shapes = new List<ShapeEle>();
public override ShapeEle DeepClone()
{
// 首先组建一个新的
ShapeMulti group = new ShapeMulti();
if (shapes != null)
{
foreach (var item in shapes)
{
group.shapes.Add(item.DeepClone());
}
}
return group;
//throw new NotImplementedException();
}
/// <summary>
/// 取得
/// </summary>
/// <param name="matrix"></param>
/// <returns></returns>
public override GraphicsPath GetGraphicsPath(Matrix matrix)
{
// 这里要先算子形状的所有的路径
GraphicsPath path = new GraphicsPath();
foreach (var item in shapes)
{
path.AddPath(item.GetGraphicsPath(matrix), false);
}
// 然后对这个进行旋转
var rect = path.GetBounds();
var centerPoints = new PointF()
{
X = rect.X + rect.Width / 2,
Y = rect.Y + rect.Height / 2
};
Matrix matrix1 = new Matrix();
matrix1.RotateAt(Angle, centerPoints);
path.Transform(matrix1);
return path;
}
public override bool Equals(object obj)
{
var shape = obj as ShapeMulti;
if (shape == null) return false; // 转换失败就是不同啦
// 群组,需要判断每一个是否相同。
if (shapes.Count != shape.shapes.Count) return false;
for (int i = 0; i < shapes.Count; i++)
{
if (shapes[i] != shape.shapes[i])
{
return false;
}
}
return true;
//return base.Equals(obj);
}
public override int GetHashCode()
{
return this.ID;
return base.GetHashCode();
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 选择了多个形状后,就放在这里边。
/// </summary>
public class ShapeMultiSelect: ShapeMulti
{
public override ShapeEle DeepClone()
{
// 首先组建一个新的
ShapeMultiSelect group = new ShapeMultiSelect();
if (shapes != null)
{
foreach (var item in shapes)
{
group.shapes.Add(item.DeepClone());
}
}
return group;
//return base.DeepClone();
}
}
}

View File

@@ -0,0 +1,48 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 扇形,跟弧度的区别是没有那个边框吧。
/// </summary>
public class ShapePie : ShapeArc
{
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapePie>(json);
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
GraphicsPath path = new GraphicsPath();
var rect = new System.Drawing.RectangleF()
{
X = getX(),
Y = getY(),
Width = getWidth(),
Height = getHeight(),
};
var rect2 = correctRectangle(rect);
path.AddPie(
rect2.X,
rect2.Y,
rect2.Width,
rect2.Height,
StartAngle,
SweepAngle);
return path;
//return base.GetGraphicsPathWithAngle();
}
}
}

View File

@@ -0,0 +1,36 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 矩形
/// </summary>
public class ShapeRectangle : ShapeEle
{
// 我将这个部分移动到ShapeEle部分了,默认情况下就是这种。
//public override GraphicsPath GetGraphicsPathWithAngle()
//{
// GraphicsPath path = new GraphicsPath();
// path.AddRectangle(new System.Drawing.RectangleF() {
// X = getX(),
// Y = getY(),
// Width = getWidth(),
// Height = getHeight()
// });
// return path;
// //throw new NotImplementedException();
//}
public override ShapeEle DeepClone()
{
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeRectangle>(json);
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,70 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Drawing;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 圆角矩形
/// </summary>
public class ShapeRoundedRectangle : ShapeEle
{
[DescriptionAttribute("圆角半径"), DisplayName("圆角半径"), CategoryAttribute("布局")]
public float Radius { get; set; }
/// <summary>
/// 构造函数
/// </summary>
public ShapeRoundedRectangle()
{
// 有些参数默认不能是0
Radius = 2;
}
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeRoundedRectangle>(json);
//throw new NotImplementedException();
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
var _x = getX();
var _y = getY();
var _width = getWidth();
var _height = getHeight();
var path = new GraphicsPath();
// 这里要注意判断圆角半径可能是0的情况。
path.StartFigure();
// 上边
path.AddLine(new PointF(_x + Radius, _y), new PointF(_x + _width - Radius, _y));
// 右上角
if(Radius > 0) path.AddArc(new RectangleF(_x + _width - Radius * 2 , _y, Radius* 2, Radius * 2), 270, 90);
// 右边
path.AddLine(new PointF(_x + _width, _y + Radius), new PointF(_x + _width, _y + _height - Radius));
// 右下角
if (Radius > 0) path.AddArc(new RectangleF(_x + _width - Radius * 2, _y + _height - Radius * 2, Radius*2, Radius*2), 0, 90);
// 下边
path.AddLine(new PointF(_x + Radius, _y + _height), new PointF(_x + _width - Radius , _y + _height));
// 右下角
if (Radius > 0) path.AddArc(new RectangleF(_x, _y + _height - Radius*2, Radius*2, Radius*2), 90, 90);
// 左边
path.AddLine(new PointF(_x, _y + Radius ), new PointF(_x, _y + _height - Radius));
// 左上角
if (Radius > 0) path.AddArc(new RectangleF(_x, _y, Radius*2, Radius*2), 180, 90);
path.CloseFigure();
return path;
//return base.GetGraphicsPathWithAngle();
}
}
}

View File

@@ -0,0 +1,29 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 拉伸
/// </summary>
public class ShapeStretch : ShapeEle
{
[DescriptionAttribute("拉伸"), DisplayName("拉伸"), CategoryAttribute("外观")]
public bool isStretch { get; set; }
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeStretch>(json);
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,171 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
// todo 这个以后支持拉伸。
/// <summary>
/// 文本
/// </summary>
public class ShapeText : ShapeVar
{
#region
[DescriptionAttribute("前缀"), DisplayName("前缀"), CategoryAttribute("文本")]
public string Piefix { get; set; }
[DescriptionAttribute("后缀"), DisplayName("后缀"), CategoryAttribute("文本")]
public string Suffix { get; set; }
#endregion
#region
[DescriptionAttribute("字体"), DisplayName("字体"), CategoryAttribute("字体")]
public Font Font { get; set; }
[DescriptionAttribute("水平对齐方式"), DisplayName("水平对齐方式"), CategoryAttribute("字体")]
public StringAlignment Alignment { get; set; }
[DescriptionAttribute("垂直对齐方式"), DisplayName("垂直对齐方式"), CategoryAttribute("字体")]
public StringAlignment LineAlignment { get; set; }
#endregion
public ShapeText() : base()
{
// 设置摩尔默认的字体。
Font = new Font("Arial", 8);
Piefix = "前缀";
StaticText = "文本";
Suffix = "后缀";
PenWidth = 0;
IsFill = true;
FillColor = Color.Black;
}
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeText>(json);
//throw new NotImplementedException();
}
public override string getText()
{
return Piefix + (string.IsNullOrEmpty(this.VarName) ? StaticText : this.VarValue) + Suffix;
}
public override bool isVisible(Matrix matrix, PointF mousePointF)
{
// todo 这个是判断文本框的内部。
return base.isVisible(matrix, mousePointF);
}
public override bool isOutlineVisible(Matrix matrix, PointF mousePointF)
{
// 这个会
return base.isOutlineVisible(matrix, mousePointF) || isVisible(matrix, mousePointF);
}
public override GraphicsPath GetGraphicsPathWithAngle()
{
GraphicsPath path = new GraphicsPath();
var rect = new RectangleF()
{
X = getX(),
Y = getY(),
Width = getWidth(),
Height = getWidth(),
};
path.AddString(
getText(),
Font.FontFamily,
(int)Font.Style,
Font.Size,
rect,
new StringFormat() { Alignment=Alignment, LineAlignment=LineAlignment}
);
return path;
//throw new NotImplementedException();
}
public override bool isBeContains(Matrix matrix, RectangleF rect)
{
// 这个要判断是否整个文本内容是否在这个矩形内,而不是单独的看这个文本的框。
// 这里要判断是否有文字,有时候没有文字,就按照基类的吧
RectangleF rect2;
if(getText() != string.Empty)
{
// 如果有文字,返回文字的范围
rect2 = GetTrueBounds(matrix);
}
else
{
// 如果没有文字,就选择外边边框的范围
rect2 = GetBounds(matrix);
}
return rect.Contains(rect2);
//return base.isBeContains(matrix, rect);
}
/// <summary>
/// 这个返回的是矩形边框
/// </summary>
/// <param name="matrix"></param>
/// <returns></returns>
public override RectangleF GetBounds(Matrix matrix)
{
// 这里不用这个文本图形的GetGraphicsPathWithAngle而是调用矩形的。
GraphicsPath path = base.GetGraphicsPathWithAngle();
// 这里加上旋转
Matrix matrix1 = new Matrix();
// 这里按照中心点旋转,
var rect = path.GetBounds();
var centerPoint = new PointF() { X = rect.X + rect.Width / 2, Y = rect.Y + rect.Height / 2 };
matrix1.RotateAt(Angle, centerPoint);
Matrix matrix2 = matrix.Clone();
matrix2.Multiply(matrix1);
// 应用这个转换
path.Transform(matrix2);
// 返回这个矩形
return path.GetBounds();
//return base.GetBounds(matrix);
}
/// <summary>
/// 返回的是实际文字的边框
/// </summary>
/// <param name="matrix"></param>
/// <returns></returns>
public RectangleF GetTrueBounds(Matrix matrix)
{
GraphicsPath path = GetGraphicsPathWithAngle();
// 这里加上旋转
Matrix matrix1 = new Matrix();
// 这里按照中心点旋转,
var rect = path.GetBounds();
// 我这里做一个判断如果这里上边的全是0那么就手动计算宽度和高度吧
var centerPoint = new PointF() { X = rect.X + rect.Width / 2, Y = rect.Y + rect.Height / 2 };
matrix1.RotateAt(Angle, centerPoint);
Matrix matrix2 = matrix.Clone();
matrix2.Multiply(matrix1);
// 应用这个转换
path.Transform(matrix2);
// 返回这个路径
return path.GetBounds();
//return base.GetBounds(matrix);
}
}
}

View File

@@ -0,0 +1,70 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
/// <summary>
/// 变量,主要是支持外部输入变量
/// </summary>
public class ShapeVar : ShapeStretch
{
[DescriptionAttribute("对应excel中的一列数据"), DisplayName("变量名"), CategoryAttribute("变量")]
public string VarName { get; set; }
[Browsable(false)]//不在PropertyGrid上显示
public string VarValue { get; set; }
[DescriptionAttribute("没有指定变量时的文本"), DisplayName("文本"), CategoryAttribute("文本")]
public string StaticText { get; set; }
public override ShapeEle DeepClone()
{
// 这里用json的方式
string json = JsonConvert.SerializeObject(this);
return JsonConvert.DeserializeObject<ShapeVar>(json);
//throw new NotImplementedException();
}
public override void setVals(Dictionary<string, string> vars)
{
if (VarName != null)
{
//首先判断是否有这个
if (vars.ContainsKey(VarName))
{
VarValue = vars[VarName]; // 这个变量的值
}
else
{
VarValue = string.Empty; // 没有是空字符串。
}
}
}
/// <summary>
/// 取得文本
/// </summary>
/// <returns></returns>
public virtual string getText()
{
return string.IsNullOrEmpty(this.VarName) ? StaticText : this.VarValue;
}
public override bool Equals(object obj)
{
var shape = obj as ShapeVar;
if (shape == null) return false; // 转换失败就是不同啦
return base.Equals(obj) && this.VarName == shape.VarName;
}
}
}

363
LibShapes/Core/Shapes.cs Normal file
View File

@@ -0,0 +1,363 @@
using Io.Github.Kerwinxu.LibShapes.Core.Serialize;
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core
{
/// <summary>
/// 图形的集合
/// </summary>
public class Shapes
{
#region
private static ISerialize serialize = new JsonSerialize();
/// <summary>
/// 读取
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static Shapes load(string filename)
{
if (serialize != null
&& ! string.IsNullOrEmpty(filename)
&& System.IO.File.Exists(filename))
{
return serialize.DeserializeObject<Shapes>(System.IO.File.ReadAllText(filename));
}
else
{
return null;
}
}
/// <summary>
/// 写入
/// </summary>
/// <param name="filename"></param>
public void save(string filename)
{
// 写入文件
if (serialize != null)
{
System.IO.File.WriteAllText(filename, serialize.SerializeObject(this));
}
}
#endregion
#region json保存
// 图形的集合
public List<ShapeEle> lstShapes { get; set; }
/// <summary>
/// 坐标转换
/// </summary>
public PointTransform pointTransform { get; set; }
/// <summary>
/// 纸张的信息
/// </summary>
public Paper.Paper Paper { get; set; }
/// <summary>
/// 变量信息
/// </summary>
private Dictionary<string,string> _vars;
public Dictionary<string,string> Vars
{
get { return _vars; }
set {
_vars = value;
// 然后这里直接更新吧。
if (value != null && lstShapes != null && lstShapes.Count > 0)
{
foreach (var item in lstShapes)
{
item.setVals(value);
}
}
}
}
#endregion
#region
public Shapes()
{
lstShapes = new List<ShapeEle>();
pointTransform = new PointTransform();
//Paper = new Paper.Paper();
Vars = new Dictionary<string, string>();
}
#endregion
#region
/// <summary>
///
/// </summary>
/// <param name="g"></param>
/// <param name="matrix">偏移和放大</param>
/// <param name="isShowModelBackground">是否打印模板背景</param>
public void Draw(Graphics g, Matrix matrix, bool isShowModelBackground=true)
{
// 1. 先初始化
initGraphics(g);
// 2. 绘制模板背景
if (isShowModelBackground && this.Paper != null && this.Paper.ModelShape != null)
{
// 这个纸张的绘制xy都是0width和height是模板的宽和高不是纸张的。
this.Paper.ModelShape.X = 0;
this.Paper.ModelShape.Y = 0;
this.Paper.ModelShape.Draw(g, matrix);
}
// 3. 显示所有的图形。
if (lstShapes != null && lstShapes.Count > 0)
{
foreach (var item in lstShapes)
{
item.Draw(g, matrix); // 绘图每一个
}
}
}
/// <summary>
/// 这个返回偏移和放大后的矩阵
/// </summary>
/// <returns></returns>
public Matrix GetMatrix()
{
return pointTransform.GetMatrix();
}
/// <summary>
/// 这个主要是用来初始化的,高精度的
/// </summary>
/// <param name="g"></param>
private void initGraphics(Graphics g)
{
g.SmoothingMode = SmoothingMode.HighQuality; // 高质量
g.PixelOffsetMode = PixelOffsetMode.HighQuality; // 指定高质量、低速度呈现。
g.PageUnit = GraphicsUnit.Millimeter; //将毫米设置为度量单位
}
/// <summary>
/// 鼠标单机选择一个形状
/// </summary>
/// <param name="pointF"></param>
/// <returns></returns>
public ShapeEle getSelectShape(PointF pointF)
{
if (lstShapes != null && lstShapes.Count > 0)
{
foreach (var shape in lstShapes)
{
if (shape.IsFill)
{
if (shape.isVisible(pointTransform.GetMatrix(), pointF))
{
return shape;
}
}
else
{
if (shape.isOutlineVisible(pointTransform.GetMatrix(), pointF))
{
return shape;
}
}
}
}
return null;
}
/// <summary>
/// 选择矩形框内的形状
/// </summary>
/// <param name="rect"></param>
/// <returns></returns>
public List<ShapeEle> getSelectShapes(RectangleF rect)
{
var matrix = pointTransform.GetMatrix();
if (lstShapes!= null && lstShapes.Count > 0)
{
return lstShapes.Where(x => x.isBeContains(matrix, rect)).ToList();
}
return null;
}
public int getNextId()
{
// 首先取得所有的id
var ids = getIds(this.lstShapes);
if (ids.Count == 0)
{
return 1;
}
int i = ids.Max() + 1;
while (ids.Contains(i))
{
i++; // 不重复的,
}
return i; // 这里简单一点。
}
/// <summary>
/// 取得所有的id
/// </summary>
/// <param name="shapeeles"></param>
/// <returns></returns>
private List<int>getIds(List<ShapeEle> shapeeles)
{
List<int> ids = shapeeles.Where(x => !(x is ShapeGroup)).Select(x => x.ID).ToList();
foreach (var item in shapeeles.Where(x => x is ShapeGroup))
{
ids.AddRange(getIds(((ShapeGroup)item).shapes));
}
return ids;
}
/// <summary>
/// 根据某个id取得相应的形状。
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ShapeEle getShape(int id)
{
return getShape(lstShapes, id);
}
private ShapeEle getShape(List<ShapeEle> shapeeles, int id)
{
if (shapeeles!=null)
{
foreach (var item in shapeeles)
{
if (item.ID == id)
{
return item;
}
if (item is ShapeGroup) // 如果是群组
{
var tmp = getShape(((ShapeGroup)item).shapes,id);
if (tmp != null) return tmp;
}
}
}
return null;
}
/// <summary>
/// 将这个id的形状替换了。
/// </summary>
/// <param name="id"></param>
/// <param name="shape"></param>
public void replaceShape(int id, ShapeEle shape)
{
replaceShape(lstShapes, id, shape);
}
private void replaceShape(List<ShapeEle> shapeeles, int id, ShapeEle shape)
{
// 遍历所有的形状
for (int i = 0; i < shapeeles.Count; i++)
{
if (shapeeles[i] is ShapeGroup)
{
replaceShape(((ShapeGroup)shapeeles[i]).shapes, id, shape);
}
if (shapeeles[i].ID == id)
{
// 找到了
shapeeles.RemoveAt(i);
shapeeles.Insert(i, shape);
return;
}
}
}
/// <summary>
/// 这个是缩放到指定的大小。
/// </summary>
/// <param name="dpix"></param>
/// <param name="dpiy"></param>
/// <param name="width">像素宽度</param>
/// <param name="height">像素高度</param>
/// <param name="spacing">像素间距</param>
public void zoomTo(float dpix, float dpiy, float width, float height, float spacing)
{
// 然后计算放大
var width2 = (width - spacing * 2) / dpix * 25.4; // 转成mm
var height2 = (height - spacing * 2) / dpiy * 25.4; // 转成mm
// 然后计算所有图形的的宽度和高度
ShapeGroup group = new ShapeGroup();
group.shapes = lstShapes.Select(x => x).ToList();// 这里用复制的方式
// 这里要判断是否有纸张
if (this.Paper != null && this.Paper.ModelShape != null)
{
group.shapes.Add(this.Paper.ModelShape);
}
// 如果没有图形,就直接退出
if (group.shapes.Count == 0) return;
//
var rect = group.GetBounds(new Matrix());// 取得不存在放大偏移的情况下,这个的尺寸
// 这里解方程,思路是,画布的宽度=倍数*(形状总宽度+两边间距的宽度)
//width/dpix*25.4 = zoom * (rect.Width + spacing*2/dpix*25.4 /zoom)
// width/dpix*25.4 = zoom * (rect.Width + spacing*2/dpix*25.4
var scale1 = (width / dpix * 25.4f - spacing * 2 / dpix * 25.4f) / rect.Width;
var scale2 = (height / dpiy * 25.4f - spacing * 2 / dpiy * 25.4f) / rect.Height;
// 取得较小值
this.pointTransform.Zoom = scale1 < scale2 ? scale1 : scale2; // 取得较小值。
// 然后这里有一个偏移要算正负两个方向的偏移要流出两边的spacing主要留出左边和上边就可以了。
this.pointTransform.OffsetX = - rect.X + spacing / dpix * 25.4f ;
this.pointTransform.OffsetY = - rect.Y + spacing / dpix * 25.4f ;
}
/// <summary>
/// 深度复制一个
/// </summary>
/// <returns></returns>
public Shapes DeepClone()
{
//这里用json的方式
JsonSerialize jsonSerialize = new JsonSerialize();
string json = jsonSerialize.SerializeObject(this);
// 可能原因是存在自定义对象的集合,所以这里要用复杂的方式去做
return jsonSerialize.DeserializeObject<Shapes>(json);
}
#endregion
}
}

View File

@@ -0,0 +1,37 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 更改策略
/// </summary>
interface IChangeStrategy
{
/// <summary>
/// 是否合适这个策略
/// </summary>
/// <param name="pointFs"></param>
/// <param name="start_pointF"></param>
/// <returns></returns>
bool isRight(PointF [] pointFs, PointF start_pointF);
/// <summary>
/// 这个策略的执行,
/// </summary>
/// <param name="shape"></param>
void action(ShapeEle shape, PointF start_pointF, PointF end_pointF);
/// <summary>
/// 更改成的鼠标样式
/// </summary>
/// <returns></returns>
Cursor changeCursor();
}
}

View File

@@ -0,0 +1,39 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 移动
/// </summary>
public class MoveMode : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
// 这个是更改xy的
RectangleF rect = new RectangleF() {
X = end_pointF.X-start_pointF.X,
Y = end_pointF.Y - start_pointF.Y
};
shape.Change(rect);
//throw new NotImplementedException();
}
public Cursor changeCursor()
{
return Cursors.Hand;
throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return true;// 一般是最后一项。
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,45 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
public class ResizeModeEast : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
// 右边的话是更改x或者width
RectangleF rect = new RectangleF();
var diff = end_pointF.X - start_pointF.X;
if (shape.Width < 0)
{
rect.X = diff;
}
else
{
rect.Width = diff;
}
shape.Change(rect);
//throw new NotImplementedException();
}
public Cursor changeCursor()
{
return Cursors.PanEast;
//throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
// 判断一句是跟右边的线足够的近。
return DistanceCalculation.pointToLine(start_pointF, pointFs[1], pointFs[2]) <= DistanceCalculation.select_tolerance;
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,54 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 北方更改大小
/// </summary>
public class ResizeModeNorth : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
// 右边的话是更改x或者width
RectangleF rect = new RectangleF();
var diff = end_pointF.Y - start_pointF.Y;
if (shape.Height < 0)
{
rect.Height = -diff;
rect.Height = diff;
Trace.WriteLine($"修改h:{rect}");
}
else
{
rect.Y = diff;
rect.Height = -diff;
Trace.WriteLine($"修改y:{rect}");
}
shape.Change(rect);
//throw new NotImplementedException();
}
public Cursor changeCursor()
{
return Cursors.PanNorth;
//throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.pointToLine(start_pointF, pointFs[0], pointFs[1]) <= DistanceCalculation.select_tolerance;
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,59 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 东北方向更改
/// </summary>
public class ResizeModeNorthEast : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
RectangleF rect = new RectangleF();
var diffx = end_pointF.X - start_pointF.X;
var diffy = end_pointF.Y - start_pointF.Y;
if (shape.Width < 0)
{
rect.X = diffx;
rect.Width = -diffx;
}
else
{
rect.Width = diffx;
}
if (shape.Height < 0)
{
rect.Y = -diffy;
rect.Height = diffy;
}
else
{
rect.Y = diffy;
rect.Height = -diffy;
}
Trace.WriteLine($"更改:{rect}");
shape.Change(rect);
}
public Cursor changeCursor()
{
return Cursors.PanNE;
//throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.distance(start_pointF, pointFs[1]) <= DistanceCalculation.select_tolerance * 2;
}
}
}

View File

@@ -0,0 +1,54 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 西北
/// </summary>
public class ResizeModeNorthWest : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
RectangleF rect = new RectangleF();
var diffx = end_pointF.X - start_pointF.X;
var diffy = end_pointF.Y - start_pointF.Y;
if (shape.Width < 0)
{
rect.Width = -diffx;
}
else
{
rect.X = diffx;
rect.Width = -diffx;
}
if (shape.Height < 0)
{
rect.Height = -diffy;
}
else
{
rect.Y = diffy;
rect.Height = -diffy;
}
shape.Change(rect);
}
public Cursor changeCursor()
{
return Cursors.PanNW;
//throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.distance(start_pointF, pointFs[0]) <= DistanceCalculation.select_tolerance * 2 ;
}
}
}

View File

@@ -0,0 +1,53 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 西南
/// </summary>
public class ResizeModeSorthWest : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
RectangleF rect = new RectangleF();
var diffx = end_pointF.X - start_pointF.X;
var diffy = end_pointF.Y - start_pointF.Y;
if (shape.Width < 0)
{
rect.Width = -diffx;
}
else
{
rect.X = diffx;
rect.Width = -diffx;
}
if (shape.Height < 0)
{
rect.Y = diffy;
rect.Height = -diffy;
}
else
{
rect.Height = diffy;
}
shape.Change(rect);
}
public Cursor changeCursor()
{
return Cursors.PanSW;
//throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.distance(start_pointF, pointFs[3]) <= DistanceCalculation.select_tolerance * 2;
}
}
}

View File

@@ -0,0 +1,44 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 南方更改
/// </summary>
public class ResizeModeSouth : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
// 右边的话是更改x或者width
RectangleF rect = new RectangleF();
var diff = end_pointF.Y - start_pointF.Y;
if (shape.Height < 0)
{
rect.Y = diff;
}
else
{
rect.Height = diff;
}
shape.Change(rect);
}
public Cursor changeCursor()
{
return Cursors.PanSouth;
throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.pointToLine(start_pointF, pointFs[2], pointFs[3]) <= DistanceCalculation.select_tolerance;
}
}
}

View File

@@ -0,0 +1,52 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
/// <summary>
/// 东南方向更改
/// </summary>
public class ResizeModeSouthEast : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
RectangleF rect = new RectangleF();
var diffx = end_pointF.X - start_pointF.X;
var diffy = end_pointF.Y - start_pointF.Y;
if (shape.Width < 0)
{
rect.X = diffx;
}
else
{
rect.Width = diffx;
}
if (shape.Height < 0)
{
rect.Y = diffy;
}
else
{
rect.Height = diffy;
}
shape.Change(rect);
}
public Cursor changeCursor()
{
return Cursors.PanSE;
throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.distance(start_pointF, pointFs[2]) <= DistanceCalculation.select_tolerance * 2;
}
}
}

View File

@@ -0,0 +1,42 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy
{
public class ResizeModeWest : IChangeStrategy
{
public void action(ShapeEle shape, PointF start_pointF, PointF end_pointF)
{
// 右边的话是更改x或者width
RectangleF rect = new RectangleF();
var diff = end_pointF.X - start_pointF.X;
if (shape.Width < 0)
{
rect.Width = -diff;
}
else
{
rect.X = diff;
rect.Width = -diff;
}
shape.Change(rect);
}
public Cursor changeCursor()
{
return Cursors.PanWest;
throw new NotImplementedException();
}
public bool isRight(PointF[] pointFs, PointF start_pointF)
{
return DistanceCalculation.pointToLine(start_pointF, pointFs[0], pointFs[3]) <= DistanceCalculation.select_tolerance;
}
}
}

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
public class ShapeRectSelect:State
{
protected PointF endPoint;
private Pen penSelectShape = new Pen(Color.Black)
{ // 选择框的画笔
DashStyle = DashStyle.Dash,
Width = 0.2f
};
public ShapeRectSelect(UserControlCanvas canvas, PointF start_pointF) : base(canvas, start_pointF)
{
}
public ShapeRectSelect(UserControlCanvas canvas) : base(canvas)
{
}
public void Draw(Graphics g)
{
// 这个其实是绘制一个矩形。
g.DrawRectangle(
penSelectShape,
startPoint.X,
startPoint.Y,
endPoint.X-startPoint.X,
endPoint.Y - startPoint.Y);
}
public override void LeftMouseDown(PointF pointF)
{
startPoint = pointF; // 只是保存开始地址
base.LeftMouseDown(pointF);
}
public override void LeftMouseMove(PointF pointF)
{
// 保存
endPoint = pointF;
this.canvas.Refresh(); // 刷新。
//base.LeftMouseMove(pointF);
}
public override void LeftMouseUp(PointF pointF)
{
// 这里看一下是否有选择图形
endPoint = pointF;
var _rect = new RectangleF(startPoint.X, startPoint.Y, endPoint.X - startPoint.X, endPoint.Y - startPoint.Y);
var _shapes = this.canvas.shapes.getSelectShapes(_rect);
if (_shapes!=null && _shapes.Count > 0)
{
// 要更改成选择模式
this.canvas.state = new StateSelected(this.canvas);
// 如果只是选择了一个。
if (_shapes.Count == 1)
{
this.canvas.changeSelect(_shapes[0]); //
}
else
{
var multi = new Shape.ShapeMultiSelect();
multi.shapes.AddRange(_shapes);
this.canvas.changeSelect(multi); // 这个只是通知,但起始这个做不了修改的。
}
}
else
{
// 说明没有选择图形
this.canvas.changeSelect(null);
this.canvas.state = new StateStandby(this.canvas);
}
this.canvas.Refresh();
//base.LeftMouseUp(pointF);
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
public abstract class State
{
/// <summary>
/// 画布
/// </summary>
public UserControlCanvas canvas { get; set; }
public PointF startPoint { get; set; }
public State(UserControlCanvas canvas, PointF start_pointF)
{
this.canvas = canvas;
this.startPoint = start_pointF;
}
public State(UserControlCanvas canvas)
{
this.canvas = canvas;
}
public virtual void LeftMouseDown(PointF pointF) { }
public virtual void LeftMouseMove(PointF pointF) { }
public virtual void LeftMouseUp(PointF pointF) {}
public virtual void RightMouseClick(PointF pointF) { }
/// <summary>
/// 将画布的坐标转成虚拟的坐标
/// </summary>
/// <param name="pointF"></param>
/// <returns></returns>
protected PointF cantosPointToVirtualPoint(PointF pointF)
{
return this.canvas.shapes.pointTransform.CanvasToVirtualPoint(pointF);
}
}
}

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
/// <summary>
/// 画布整体的移动
/// </summary>
public class StateCanvasMove:State
{
public StateCanvasMove(UserControlCanvas canvas, PointF start_pointF) : base(canvas, start_pointF)
{
}
public StateCanvasMove(UserControlCanvas canvas) : base(canvas)
{
}
// 移动的话,我这个类会保存原先的偏移
private float old_offsetX, old_offsetY;
private Shapes oldShapes;
public override void LeftMouseDown(PointF pointF)
{
this.oldShapes = this.canvas.shapes.DeepClone();
// 保存偏移
old_offsetX = this.canvas.shapes.pointTransform.OffsetX;
old_offsetY = this.canvas.shapes.pointTransform.OffsetY;
startPoint = pointF;
base.LeftMouseDown(pointF);
}
public override void LeftMouseMove(PointF pointF)
{
float diffx = pointF.X - startPoint.X;
float diffy = pointF.Y - startPoint.Y;
// 然后修改偏移
this.canvas.shapes.pointTransform.OffsetX = old_offsetX + diffx;
this.canvas.shapes.pointTransform.OffsetY = old_offsetY + diffy;
//base.LeftMouseMove(pointF);
}
public override void LeftMouseUp(PointF pointF)
{
// 保存命令,
this.canvas.commandRecorder.addCommand(new Command.CommandShapesChanged() {
canvas = this.canvas,
OldShapes = this.oldShapes,
NewShapes = this.canvas.shapes.DeepClone(),
});
//base.LeftMouseUp(pointF);
}
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
/// <summary>
/// 画布的放大和缩小
/// </summary>
public class StateCanvasZoom:State
{
public StateCanvasZoom(UserControlCanvas canvas, PointF start_pointF) : base(canvas, start_pointF)
{
}
public StateCanvasZoom(UserControlCanvas canvas) : base(canvas)
{
}
public override void RightMouseClick(PointF pointF)
{
var oldShapes = this.canvas.shapes.DeepClone();
this.canvas.reduce(pointF);
// 保存命令,
this.canvas.commandRecorder.addCommand(new Command.CommandShapesChanged()
{
canvas = this.canvas,
OldShapes = oldShapes,
NewShapes = this.canvas.shapes.DeepClone(),
});
//base.RightMouseClick(pointF);
}
public override void LeftMouseUp(PointF pointF)
{
var oldShapes = this.canvas.shapes.DeepClone();
this.canvas.zoom(pointF);
// 保存命令,
this.canvas.commandRecorder.addCommand(new Command.CommandShapesChanged()
{
canvas =this.canvas,
OldShapes = oldShapes,
NewShapes = this.canvas.shapes.DeepClone(),
});
//base.LeftMouseUp(pointF);
}
}
}

View File

@@ -0,0 +1,121 @@
using Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
/// <summary>
/// 更改状态,都是选择后才有的。
/// </summary>
public class StateChanging:State
{
public StateChanging(UserControlCanvas canvas, PointF start_pointF) : base(canvas, start_pointF)
{
}
public StateChanging(UserControlCanvas canvas) : base(canvas)
{
}
/// <summary>
/// 原先的
/// </summary>
private Shapes oldShapes;
/// <summary>
/// 当前选择的策略
/// </summary>
private IChangeStrategy changeStrategy;
/// <summary>
/// 所有的策略
/// </summary>
private IChangeStrategy[] changeStrategies = {
// 先4个角点
new ChangeStrategy.ResizeModeNorthEast(),
new ChangeStrategy.ResizeModeNorthWest(),
new ChangeStrategy.ResizeModeSorthWest(),
new ChangeStrategy.ResizeModeSouthEast(),
// 然后4个方向
new ChangeStrategy.ResizeModeEast(),
new ChangeStrategy.ResizeModeNorth(),
new ChangeStrategy.ResizeModeSouth(),
new ChangeStrategy.ResizeModeWest(),
// 最后是移动
new ChangeStrategy.MoveMode()
};
public override void LeftMouseDown(PointF pointF)
{
oldShapes = this.canvas.shapes.DeepClone();
// 这个首先看一下是在四面还是八方上,运算是不同的。
// 这里取得坐标
var path = new GraphicsPath();
path.AddRectangle(this.canvas.SelectShape.GetBounds(this.canvas.shapes.GetMatrix()));
if (path.PointCount == 0) return;
var points = path.PathPoints;
foreach (var item in changeStrategies)
{
if (item.isRight(points, pointF))
{
changeStrategy = item;
Cursor cursor = item.changeCursor();
if (cursor != null) this.canvas.Cursor = cursor;// 更改鼠标样式。
return;
}
}
changeStrategy = null;
//base.LeftMouseDown(pointF);
}
public override void LeftMouseMove(PointF pointF)
{
if (changeStrategy != null && this.canvas.SelectShape != null)
{
// 这里要判断是否对齐网格
changeStrategy.action(
this.canvas.SelectShape,
cantosPointToVirtualPoint(this.startPoint),
cantosPointToVirtualPoint(this.canvas.gridAlign(pointF)));
this.canvas.Refresh();
}
//base.LeftMouseMove(pointF);
}
public override void LeftMouseUp(PointF pointF)
{
// 结束更改操作,然后转成选择模式
if (changeStrategy != null && this.canvas.SelectShape != null)
{
changeStrategy.action(
this.canvas.SelectShape,
cantosPointToVirtualPoint(this.startPoint),
cantosPointToVirtualPoint(this.canvas.gridAlign(pointF)));
var old = this.canvas.SelectShape.DeepClone(); // 保存旧的
this.canvas.SelectShape.ChangeComplated(); // 更改状态
//
this.canvas.commandRecorder.addCommand( // 发送命令
new Command.CommandShapesChanged()
{
canvas = this.canvas,
OldShapes = this.oldShapes,
NewShapes = this.canvas.shapes.DeepClone()
}) ;
}
// 转成
this.canvas.state = new StateSelected(this.canvas);
this.canvas.Cursor = Cursors.Default;// 换到原先的鼠标样式
this.canvas.Refresh();
//base.LeftMouseUp(pointF);
}
}
}

View File

@@ -0,0 +1,106 @@
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Core.State.ChangeStrategy;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
/// <summary>
/// 创建状态。
/// </summary>
public class StateCreate:State
{
public StateCreate(UserControlCanvas canvas, PointF start_pointF) : base(canvas, start_pointF)
{
}
public StateCreate(UserControlCanvas canvas) : base(canvas)
{
}
private Shapes oldShapes;
public ShapeEle shape { get; set; }
public StateCreate(UserControlCanvas canvas, ShapeEle shape):base(canvas)
{
this.shape = shape; // 保存要创建的图形
}
private IChangeStrategy strategy = new ResizeModeSouthEast(); // 更改的策略
private ShapeEle newshape; // 建立的图形。
public override void LeftMouseDown(PointF pointF)
{
oldShapes = this.canvas.shapes.DeepClone();
// 这里先创建一个拷贝
newshape = shape.DeepClone();
// 判断是否需要对齐
startPoint = this.canvas.gridAlign(pointF);
// 这里的坐标要转换成虚拟中的坐标
var point3 = cantosPointToVirtualPoint(startPoint);
// 这个x和y就有了
newshape.X = point3.X;
newshape.Y = point3.Y;
// 然后计算id
newshape.ID = this.canvas.shapes.getNextId();
Trace.WriteLine($"增加了一个新的图形id:{newshape.ID}");
// 然后添加到图形中
this.canvas.addShape(newshape);
// 刷新
this.canvas.Refresh();
//base.LeftMouseDown(pointF);
}
public override void LeftMouseMove(PointF pointF)
{
// 判断是否需要对齐
var point2 = cantosPointToVirtualPoint(this.canvas.gridAlign(pointF));
strategy.action(newshape, cantosPointToVirtualPoint(startPoint), point2);
// 刷新
this.canvas.Refresh();
base.LeftMouseMove(pointF);
}
public override void LeftMouseUp(PointF pointF)
{
// 这里有一个特殊的情况就是宽和高都是0的情况下会死机
var point2 = cantosPointToVirtualPoint(this.canvas.gridAlign(pointF));
strategy.action(newshape, cantosPointToVirtualPoint(startPoint), point2);
newshape.ChangeComplated();
if (newshape.Width == 0 && newshape.Height == 0)
{
this.canvas.deleteShapes(newshape);
}
else
{
// 更改成选择模式
this.canvas.state = new StateSelected(this.canvas);
// 需要发送命令
this.canvas.commandRecorder.addCommand(
new Command.CommandShapesChanged()
{
canvas=this.canvas,
OldShapes = this.oldShapes,
NewShapes = this.canvas.shapes.DeepClone()
}
) ;
// 这里还是发出改变通知
this.canvas.changeSelect(newshape);
}
//base.LeftMouseUp(pointF);
// 刷新
this.canvas.Refresh();
}
}
}

View File

@@ -0,0 +1,73 @@
using Io.Github.Kerwinxu.LibShapes.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
public class StateSelected:State
{
public StateSelected(UserControlCanvas canvas, PointF start_pointF) : base(canvas, start_pointF)
{
}
public StateSelected(UserControlCanvas canvas) : base(canvas)
{
}
public override void LeftMouseDown(PointF pointF)
{
// 首先判断一下是否在这个选择矩形的范围内
// 在的话就是更改模式了,比如更改尺寸和移动。我这个在选择框上是更改尺寸,而在内部是移动
// 如果不在,就转成待机模式
// 1. 这里判断一下是否在矩形框的范围内
GraphicsPath path = new GraphicsPath();
// 这里要判断一下是否是ShapeMultiSelect
if (this.canvas.SelectShape is Shape.ShapeMultiSelect)
{
// 那么最简单的方式是取消所有的选择,然后运行待机模式的选择
this.canvas.changeSelect(null);
this.canvas.state = new StateStandby(this.canvas);
this.canvas.state.LeftMouseDown(pointF);
}
else
{
// 如果选择的图形是其他类型
// 看看是否被选择了吧。
var rect = this.canvas.SelectShape.GetBounds(this.canvas.shapes.GetMatrix());
// 放大范围,
// 这里根据宽度和高度的情况酌情放大范围
float select_tolerance = 1;
if (rect.Width < 4 || rect.Height < 4) select_tolerance = Math.Min(rect.Height, rect.Width) / 4;
rect.X -= select_tolerance;
rect.Y -= select_tolerance;
rect.Width += select_tolerance * 2;
rect.Height += select_tolerance * 2;
path.AddRectangle(rect);
// 判断是否
if (path.IsVisible(pointF))
{
this.canvas.state = new StateChanging(this.canvas, pointF);
this.canvas.state.LeftMouseDown(pointF);
}
else
{
// 转成待机模式
this.canvas.changeSelect(null);
this.canvas.state = new StateStandby(this.canvas);
this.canvas.state.LeftMouseDown(pointF);
}
}
//base.LeftMouseDown(pointF);
}
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core.State
{
public class StateStandby : State
{
public StateStandby(UserControlCanvas canvas, PointF start_pointF):base(canvas,start_pointF)
{
}
public StateStandby(UserControlCanvas canvas) : base(canvas)
{
this.canvas.changeSelect(null);// null表示没有选择然后就是纸张。
}
public override void LeftMouseDown(PointF pointF)
{
// 首先看看是否有选择的图形
var shape = this.canvas.shapes.getSelectShape(pointF);
if (shape != null)
{
this.canvas.changeSelect(shape); // 选择这个
this.canvas.state = new StateSelected(this.canvas, pointF); // 改变状态
this.canvas.state.LeftMouseDown(pointF); // 调用他的处理
}
else
{
this.canvas.changeSelect(null);
this.canvas.state = new ShapeRectSelect(this.canvas, pointF);
this.canvas.state.LeftMouseDown(pointF);
}
this.canvas.Refresh();
//base.LeftMouseDown(e);
}
}
}

View File

@@ -0,0 +1,46 @@
namespace Io.Github.Kerwinxu.LibShapes.Core
{
partial class UserControlCanvas
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UserControlCanvas
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UserControlCanvas";
this.Paint += new System.Windows.Forms.PaintEventHandler(this.UserControlCanvas_Paint);
this.ResumeLayout(false);
}
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,582 @@
namespace Io.Github.Kerwinxu.LibShapes.Core
{
partial class UserControlToolbox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserControlToolbox));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.btn_page_setting = new System.Windows.Forms.ToolStripButton();
this.btn_zoom_screen = new System.Windows.Forms.ToolStripButton();
this.toolStrip2 = new System.Windows.Forms.ToolStrip();
this.btn_select = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.btn_rect = new System.Windows.Forms.ToolStripButton();
this.btn_roundedrect = new System.Windows.Forms.ToolStripButton();
this.btn_line = new System.Windows.Forms.ToolStripButton();
this.btn_ellipse = new System.Windows.Forms.ToolStripButton();
this.btn_arc = new System.Windows.Forms.ToolStripButton();
this.btn_pie = new System.Windows.Forms.ToolStripButton();
this.btn_img = new System.Windows.Forms.ToolStripButton();
this.btn_text = new System.Windows.Forms.ToolStripButton();
this.btn_barcode = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.btn_delete = new System.Windows.Forms.ToolStripButton();
this.btn_merge_group = new System.Windows.Forms.ToolStripButton();
this.btn_cancel_group = new System.Windows.Forms.ToolStripButton();
this.btn_forward = new System.Windows.Forms.ToolStripButton();
this.btn_forwardtofront = new System.Windows.Forms.ToolStripButton();
this.btn_backward = new System.Windows.Forms.ToolStripButton();
this.btn_wardtoend = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.combo_grid = new System.Windows.Forms.ToolStripDropDownButton();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.btn_align_grid = new System.Windows.Forms.ToolStripButton();
this.btn_zoom = new System.Windows.Forms.ToolStripButton();
this.btn_move_canvas = new System.Windows.Forms.ToolStripButton();
this.toolStrip3 = new System.Windows.Forms.ToolStrip();
this.btn_align_top = new System.Windows.Forms.ToolStripButton();
this.btn_align_bottom = new System.Windows.Forms.ToolStripButton();
this.btn_align_left = new System.Windows.Forms.ToolStripButton();
this.btn_align_right = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.btn_align_center = new System.Windows.Forms.ToolStripButton();
this.btn_align_middle = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.toolStrip1.SuspendLayout();
this.toolStrip2.SuspendLayout();
this.toolStrip3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btn_page_setting,
this.btn_zoom_screen});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(228, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// btn_page_setting
//
this.btn_page_setting.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_page_setting.Image = ((System.Drawing.Image)(resources.GetObject("btn_page_setting.Image")));
this.btn_page_setting.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_page_setting.Name = "btn_page_setting";
this.btn_page_setting.Size = new System.Drawing.Size(60, 22);
this.btn_page_setting.Text = "页面设置";
this.btn_page_setting.Click += new System.EventHandler(this.btn_page_setting_Click);
//
// btn_zoom_screen
//
this.btn_zoom_screen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_zoom_screen.Image = ((System.Drawing.Image)(resources.GetObject("btn_zoom_screen.Image")));
this.btn_zoom_screen.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_zoom_screen.Name = "btn_zoom_screen";
this.btn_zoom_screen.Size = new System.Drawing.Size(72, 22);
this.btn_zoom_screen.Text = "放大到屏幕";
this.btn_zoom_screen.Click += new System.EventHandler(this.btn_zoom_screen_Click);
//
// toolStrip2
//
this.toolStrip2.Dock = System.Windows.Forms.DockStyle.Left;
this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btn_select,
this.toolStripSeparator5,
this.btn_rect,
this.btn_roundedrect,
this.btn_line,
this.btn_ellipse,
this.btn_arc,
this.btn_pie,
this.btn_img,
this.btn_text,
this.btn_barcode,
this.toolStripSeparator1,
this.btn_delete,
this.btn_merge_group,
this.btn_cancel_group,
this.btn_forward,
this.btn_forwardtofront,
this.btn_backward,
this.btn_wardtoend,
this.toolStripSeparator2,
this.combo_grid,
this.btn_align_grid,
this.btn_zoom,
this.btn_move_canvas});
this.toolStrip2.Location = new System.Drawing.Point(0, 25);
this.toolStrip2.Name = "toolStrip2";
this.toolStrip2.Size = new System.Drawing.Size(61, 548);
this.toolStrip2.TabIndex = 1;
this.toolStrip2.Text = "toolStrip2";
//
// btn_select
//
this.btn_select.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_select.Image = ((System.Drawing.Image)(resources.GetObject("btn_select.Image")));
this.btn_select.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_select.Name = "btn_select";
this.btn_select.Size = new System.Drawing.Size(58, 21);
this.btn_select.Text = "选择";
this.btn_select.Click += new System.EventHandler(this.btn_select_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(58, 6);
//
// btn_rect
//
this.btn_rect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_rect.Image = ((System.Drawing.Image)(resources.GetObject("btn_rect.Image")));
this.btn_rect.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_rect.Name = "btn_rect";
this.btn_rect.Size = new System.Drawing.Size(58, 21);
this.btn_rect.Text = "矩形";
this.btn_rect.Click += new System.EventHandler(this.btn_rect_Click);
//
// btn_roundedrect
//
this.btn_roundedrect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_roundedrect.Image = ((System.Drawing.Image)(resources.GetObject("btn_roundedrect.Image")));
this.btn_roundedrect.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_roundedrect.Name = "btn_roundedrect";
this.btn_roundedrect.Size = new System.Drawing.Size(58, 21);
this.btn_roundedrect.Text = "圆角矩形";
this.btn_roundedrect.Click += new System.EventHandler(this.btn_roundedrect_Click);
//
// btn_line
//
this.btn_line.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_line.Image = ((System.Drawing.Image)(resources.GetObject("btn_line.Image")));
this.btn_line.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_line.Name = "btn_line";
this.btn_line.Size = new System.Drawing.Size(58, 21);
this.btn_line.Text = "线段";
this.btn_line.Click += new System.EventHandler(this.btn_line_Click);
//
// btn_ellipse
//
this.btn_ellipse.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_ellipse.Image = ((System.Drawing.Image)(resources.GetObject("btn_ellipse.Image")));
this.btn_ellipse.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_ellipse.Name = "btn_ellipse";
this.btn_ellipse.Size = new System.Drawing.Size(58, 21);
this.btn_ellipse.Text = "椭圆";
this.btn_ellipse.Click += new System.EventHandler(this.btn_ellipse_Click);
//
// btn_arc
//
this.btn_arc.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_arc.Image = ((System.Drawing.Image)(resources.GetObject("btn_arc.Image")));
this.btn_arc.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_arc.Name = "btn_arc";
this.btn_arc.Size = new System.Drawing.Size(58, 21);
this.btn_arc.Text = "弧形";
this.btn_arc.Click += new System.EventHandler(this.btn_arc_Click);
//
// btn_pie
//
this.btn_pie.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_pie.Image = ((System.Drawing.Image)(resources.GetObject("btn_pie.Image")));
this.btn_pie.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_pie.Name = "btn_pie";
this.btn_pie.Size = new System.Drawing.Size(58, 21);
this.btn_pie.Text = "扇形";
this.btn_pie.Click += new System.EventHandler(this.btn_pie_Click);
//
// btn_img
//
this.btn_img.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_img.Image = ((System.Drawing.Image)(resources.GetObject("btn_img.Image")));
this.btn_img.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_img.Name = "btn_img";
this.btn_img.Size = new System.Drawing.Size(58, 21);
this.btn_img.Text = "图片";
this.btn_img.Click += new System.EventHandler(this.btn_img_Click);
//
// btn_text
//
this.btn_text.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_text.Image = ((System.Drawing.Image)(resources.GetObject("btn_text.Image")));
this.btn_text.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_text.Name = "btn_text";
this.btn_text.Size = new System.Drawing.Size(58, 21);
this.btn_text.Text = "文本";
this.btn_text.Click += new System.EventHandler(this.btn_text_Click);
//
// btn_barcode
//
this.btn_barcode.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_barcode.Image = ((System.Drawing.Image)(resources.GetObject("btn_barcode.Image")));
this.btn_barcode.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_barcode.Name = "btn_barcode";
this.btn_barcode.Size = new System.Drawing.Size(58, 21);
this.btn_barcode.Text = "条形码";
this.btn_barcode.Click += new System.EventHandler(this.btn_barcode_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(58, 6);
//
// btn_delete
//
this.btn_delete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_delete.Image = ((System.Drawing.Image)(resources.GetObject("btn_delete.Image")));
this.btn_delete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_delete.Name = "btn_delete";
this.btn_delete.Size = new System.Drawing.Size(58, 21);
this.btn_delete.Text = "删除";
this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click);
//
// btn_merge_group
//
this.btn_merge_group.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_merge_group.Image = ((System.Drawing.Image)(resources.GetObject("btn_merge_group.Image")));
this.btn_merge_group.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_merge_group.Name = "btn_merge_group";
this.btn_merge_group.Size = new System.Drawing.Size(58, 21);
this.btn_merge_group.Text = "组成群组";
this.btn_merge_group.Click += new System.EventHandler(this.btn_merge_group_Click);
//
// btn_cancel_group
//
this.btn_cancel_group.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_cancel_group.Image = ((System.Drawing.Image)(resources.GetObject("btn_cancel_group.Image")));
this.btn_cancel_group.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_cancel_group.Name = "btn_cancel_group";
this.btn_cancel_group.Size = new System.Drawing.Size(58, 21);
this.btn_cancel_group.Text = "取消群组";
this.btn_cancel_group.Click += new System.EventHandler(this.btn_cancel_group_Click);
//
// btn_forward
//
this.btn_forward.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_forward.Image = ((System.Drawing.Image)(resources.GetObject("btn_forward.Image")));
this.btn_forward.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_forward.Name = "btn_forward";
this.btn_forward.Size = new System.Drawing.Size(58, 21);
this.btn_forward.Text = "移前一位";
this.btn_forward.Click += new System.EventHandler(this.btn_forward_Click);
//
// btn_forwardtofront
//
this.btn_forwardtofront.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_forwardtofront.Image = ((System.Drawing.Image)(resources.GetObject("btn_forwardtofront.Image")));
this.btn_forwardtofront.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_forwardtofront.Name = "btn_forwardtofront";
this.btn_forwardtofront.Size = new System.Drawing.Size(58, 21);
this.btn_forwardtofront.Text = "移到最前";
this.btn_forwardtofront.Click += new System.EventHandler(this.btn_forwardtofront_Click);
//
// btn_backward
//
this.btn_backward.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_backward.Image = ((System.Drawing.Image)(resources.GetObject("btn_backward.Image")));
this.btn_backward.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_backward.Name = "btn_backward";
this.btn_backward.Size = new System.Drawing.Size(58, 21);
this.btn_backward.Text = "移后一位";
this.btn_backward.Click += new System.EventHandler(this.btn_backward_Click);
//
// btn_wardtoend
//
this.btn_wardtoend.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_wardtoend.Image = ((System.Drawing.Image)(resources.GetObject("btn_wardtoend.Image")));
this.btn_wardtoend.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_wardtoend.Name = "btn_wardtoend";
this.btn_wardtoend.Size = new System.Drawing.Size(58, 21);
this.btn_wardtoend.Text = "移到最后";
this.btn_wardtoend.Click += new System.EventHandler(this.btn_wardtoend_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(58, 6);
//
// combo_grid
//
this.combo_grid.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.combo_grid.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.toolStripMenuItem2,
this.toolStripMenuItem3,
this.toolStripMenuItem4});
this.combo_grid.Image = ((System.Drawing.Image)(resources.GetObject("combo_grid.Image")));
this.combo_grid.ImageTransparentColor = System.Drawing.Color.Magenta;
this.combo_grid.Name = "combo_grid";
this.combo_grid.Size = new System.Drawing.Size(58, 21);
this.combo_grid.Text = "网格";
this.combo_grid.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.combo_grid_DropDownItemClicked);
//
// 关闭ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "关闭ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem.Text = "关闭";
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(100, 22);
this.toolStripMenuItem2.Text = "1";
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(100, 22);
this.toolStripMenuItem3.Text = "2";
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(100, 22);
this.toolStripMenuItem4.Text = "5";
//
// btn_align_grid
//
this.btn_align_grid.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_align_grid.Image = ((System.Drawing.Image)(resources.GetObject("btn_align_grid.Image")));
this.btn_align_grid.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_grid.Name = "btn_align_grid";
this.btn_align_grid.Size = new System.Drawing.Size(58, 21);
this.btn_align_grid.Text = "对齐网格";
this.btn_align_grid.Click += new System.EventHandler(this.btn_align_grid_Click);
//
// btn_zoom
//
this.btn_zoom.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_zoom.Image = ((System.Drawing.Image)(resources.GetObject("btn_zoom.Image")));
this.btn_zoom.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_zoom.Name = "btn_zoom";
this.btn_zoom.Size = new System.Drawing.Size(58, 21);
this.btn_zoom.Text = "放大缩小";
this.btn_zoom.Click += new System.EventHandler(this.btn_zoom_Click);
//
// btn_move_canvas
//
this.btn_move_canvas.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btn_move_canvas.Image = ((System.Drawing.Image)(resources.GetObject("btn_move_canvas.Image")));
this.btn_move_canvas.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_move_canvas.Name = "btn_move_canvas";
this.btn_move_canvas.Size = new System.Drawing.Size(58, 21);
this.btn_move_canvas.Text = "移动画布";
this.btn_move_canvas.Click += new System.EventHandler(this.btn_move_canvas_Click);
//
// toolStrip3
//
this.toolStrip3.Dock = System.Windows.Forms.DockStyle.Left;
this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btn_align_top,
this.btn_align_bottom,
this.btn_align_left,
this.btn_align_right,
this.toolStripSeparator3,
this.btn_align_center,
this.btn_align_middle,
this.toolStripSeparator4});
this.toolStrip3.Location = new System.Drawing.Point(61, 25);
this.toolStrip3.Name = "toolStrip3";
this.toolStrip3.Size = new System.Drawing.Size(24, 548);
this.toolStrip3.TabIndex = 2;
this.toolStrip3.Text = "toolStrip3";
//
// btn_align_top
//
this.btn_align_top.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btn_align_top.Image = global::Io.Github.Kerwinxu.LibShapes.Properties.Resources.shape_align_top;
this.btn_align_top.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_top.Name = "btn_align_top";
this.btn_align_top.Size = new System.Drawing.Size(21, 20);
this.btn_align_top.Text = "btn_align_top";
this.btn_align_top.ToolTipText = "上对齐";
this.btn_align_top.Click += new System.EventHandler(this.btn_align_top_Click);
//
// btn_align_bottom
//
this.btn_align_bottom.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btn_align_bottom.Image = global::Io.Github.Kerwinxu.LibShapes.Properties.Resources.shape_align_bottom;
this.btn_align_bottom.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_bottom.Name = "btn_align_bottom";
this.btn_align_bottom.Size = new System.Drawing.Size(21, 20);
this.btn_align_bottom.Text = "btn_align_bottom";
this.btn_align_bottom.ToolTipText = "下对齐";
this.btn_align_bottom.Click += new System.EventHandler(this.btn_align_bottom_Click);
//
// btn_align_left
//
this.btn_align_left.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btn_align_left.Image = global::Io.Github.Kerwinxu.LibShapes.Properties.Resources.shape_align_left;
this.btn_align_left.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_left.Name = "btn_align_left";
this.btn_align_left.Size = new System.Drawing.Size(21, 20);
this.btn_align_left.Text = "btn_align_left";
this.btn_align_left.ToolTipText = "左对齐";
this.btn_align_left.Click += new System.EventHandler(this.btn_align_left_Click);
//
// btn_align_right
//
this.btn_align_right.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btn_align_right.Image = global::Io.Github.Kerwinxu.LibShapes.Properties.Resources.align_right;
this.btn_align_right.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_right.Name = "btn_align_right";
this.btn_align_right.Size = new System.Drawing.Size(21, 20);
this.btn_align_right.Text = "btn_align_right";
this.btn_align_right.ToolTipText = "右对齐";
this.btn_align_right.Click += new System.EventHandler(this.btn_align_right_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(21, 6);
//
// btn_align_center
//
this.btn_align_center.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btn_align_center.Image = global::Io.Github.Kerwinxu.LibShapes.Properties.Resources.shape_align_center;
this.btn_align_center.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_center.Name = "btn_align_center";
this.btn_align_center.Size = new System.Drawing.Size(21, 20);
this.btn_align_center.Text = "btn_align_center";
this.btn_align_center.ToolTipText = "水平居中";
this.btn_align_center.Click += new System.EventHandler(this.btn_align_center_Click);
//
// btn_align_middle
//
this.btn_align_middle.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btn_align_middle.Image = global::Io.Github.Kerwinxu.LibShapes.Properties.Resources.shape_align_middle;
this.btn_align_middle.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_align_middle.Name = "btn_align_middle";
this.btn_align_middle.Size = new System.Drawing.Size(21, 20);
this.btn_align_middle.Text = "btn_align_middle";
this.btn_align_middle.ToolTipText = "垂直居中";
this.btn_align_middle.Click += new System.EventHandler(this.btn_align_middle_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(21, 6);
//
// propertyGrid1
//
this.propertyGrid1.Location = new System.Drawing.Point(90, 28);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.Size = new System.Drawing.Size(133, 539);
this.propertyGrid1.TabIndex = 3;
//
// errorProvider1
//
this.errorProvider1.ContainerControl = this;
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// UserControlToolbox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.propertyGrid1);
this.Controls.Add(this.toolStrip3);
this.Controls.Add(this.toolStrip2);
this.Controls.Add(this.toolStrip1);
this.Name = "UserControlToolbox";
this.Size = new System.Drawing.Size(228, 573);
this.Resize += new System.EventHandler(this.UserControlToolbox_Resize);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.toolStrip2.ResumeLayout(false);
this.toolStrip2.PerformLayout();
this.toolStrip3.ResumeLayout(false);
this.toolStrip3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStrip toolStrip2;
private System.Windows.Forms.ToolStrip toolStrip3;
private System.Windows.Forms.ToolStripButton btn_select;
private System.Windows.Forms.ToolStripButton btn_page_setting;
private System.Windows.Forms.ToolStripButton btn_zoom_screen;
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.ErrorProvider errorProvider1;
private System.Windows.Forms.ToolStripButton btn_rect;
private System.Windows.Forms.ToolStripButton btn_roundedrect;
private System.Windows.Forms.ToolStripButton btn_line;
private System.Windows.Forms.ToolStripButton btn_ellipse;
private System.Windows.Forms.ToolStripButton btn_arc;
private System.Windows.Forms.ToolStripButton btn_pie;
private System.Windows.Forms.ToolStripButton btn_img;
private System.Windows.Forms.ToolStripButton btn_text;
private System.Windows.Forms.ToolStripButton btn_barcode;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton btn_delete;
private System.Windows.Forms.ToolStripButton btn_merge_group;
private System.Windows.Forms.ToolStripButton btn_cancel_group;
private System.Windows.Forms.ToolStripButton btn_forward;
private System.Windows.Forms.ToolStripButton btn_forwardtofront;
private System.Windows.Forms.ToolStripButton btn_backward;
private System.Windows.Forms.ToolStripButton btn_wardtoend;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripDropDownButton combo_grid;
private System.Windows.Forms.ToolStripButton btn_align_grid;
private System.Windows.Forms.ToolStripButton btn_zoom;
private System.Windows.Forms.ToolStripButton btn_align_left;
private System.Windows.Forms.ToolStripButton btn_align_right;
private System.Windows.Forms.ToolStripButton btn_align_top;
private System.Windows.Forms.ToolStripButton btn_align_bottom;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripButton btn_align_middle;
private System.Windows.Forms.ToolStripButton btn_align_center;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripButton btn_move_canvas;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
}
}

View File

@@ -0,0 +1,504 @@
using Io.Github.Kerwinxu.LibShapes.Core.Event;
using Io.Github.Kerwinxu.LibShapes.Core.Paper;
using Io.Github.Kerwinxu.LibShapes.Core.Shape;
using Io.Github.Kerwinxu.LibShapes.Core.State;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Io.Github.Kerwinxu.LibShapes.Core
{
public partial class UserControlToolbox : UserControl
{
public UserControlToolbox()
{
InitializeComponent();
UserControlToolbox_Resize(this, null); // 更改尺寸。
// 对象的属性更改时
propertyGrid1.PropertyValueChanged += PropertyGrid1_PropertyValueChanged;
}
private void PropertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
// 发送给外接
if (this.PropertyValueChanged != null)
{
this.PropertyValueChanged(s, e);
}
//throw new NotImplementedException();
}
/// <summary>
/// 这个工具箱是操作画布的,这里用一个属性关联
/// </summary>
public UserControlCanvas canvas { get; set; }
/// <summary>
/// 选择更改事件的处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void objectSelected(object sender, ObjectSelectEventArgs e)
{
propertyGrid1.SelectedObject = e.obj;
}
/// <summary>
/// 状态更改事件的处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void stateChanged(object sender, StateChangedEventArgs e)
{
all_reset_1();
//
if (e.CurrentState is StateCanvasZoom)
{
btn_zoom.Checked = true;
}else if (e.CurrentState is StateCanvasMove)
{
btn_move_canvas.Checked = true;
}
else
{
btn_select.Checked = true;
}
all_reset_2();
if (e.CurrentState is StateCreate)
{
// 如果是创建模式,要看看是哪个形状的
var tmp = e.CurrentState as StateCreate;
if (tmp.shape is ShapePie)
{
btn_pie.Checked = true;
}
else if (tmp.shape is ShapeArc)
{
btn_arc.Checked = true;
}
else if (tmp.shape is ShapeEllipse)
{
btn_ellipse.Checked = true;
}
else if (tmp.shape is ShapeRectangle)
{
btn_rect.Checked = true;
}else if (tmp.shape is ShapeRoundedRectangle)
{
btn_roundedrect.Checked = true;
}
else if (tmp.shape is ShapeLine)
{
btn_line.Checked = true;
}
else if (tmp.shape is ShapeImage)
{
btn_img.Checked = true;
}
else if (tmp.shape is ShapeText)
{
btn_text.Checked = true;
}
else if (tmp.shape is ShapeBarcode)
{
btn_barcode.Checked = true;
}
}
}
/// <summary>
/// 这里是属性更改事件
/// </summary>
public event System.Windows.Forms.PropertyValueChangedEventHandler PropertyValueChanged;
/// <summary>
/// 将所有的设置成没有选中的状态
/// </summary>
private void all_reset_1()
{
btn_select.Checked = false;
btn_zoom.Checked = false;
btn_move_canvas.Checked = false;
}
private void all_reset_2()
{
btn_rect.Checked = false;
btn_roundedrect.Checked = false;
btn_line.Checked = false;
btn_arc.Checked = false;
btn_pie.Checked = false;
btn_img.Checked = false;
btn_text.Checked = false;
btn_barcode.Checked = false;
btn_ellipse.Checked = false;
}
/// <summary>
/// 新建形状,方便创建形状的
/// </summary>
/// <param name="shape"></param>
private void create_shape(ShapeEle shape)
{
if (canvas != null)
{
canvas.state = new StateCreate(this.canvas, shape);
}
}
/// <summary>
/// 矩形
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_rect_Click(object sender, EventArgs e)
{
create_shape(new ShapeRectangle());
}
/// <summary>
/// 圆角矩形
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_roundedrect_Click(object sender, EventArgs e)
{
create_shape(new ShapeRoundedRectangle());
}
/// <summary>
/// 线段
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_line_Click(object sender, EventArgs e)
{
create_shape(new ShapeLine());
}
/// <summary>
/// 椭圆
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_ellipse_Click(object sender, EventArgs e)
{
create_shape(new ShapeEllipse());
}
/// <summary>
/// 椭圆弧
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_arc_Click(object sender, EventArgs e)
{
create_shape(new ShapeArc());
}
/// <summary>
/// 扇形
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_pie_Click(object sender, EventArgs e)
{
create_shape(new ShapePie());
}
private void btn_img_Click(object sender, EventArgs e)
{
// 这里首先要读取图片
openFileDialog1.Filter = "图片文件|*.jpg;*.jpeg;*.png";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
// 这里要读取图片,然后转换。
var shapeImg = new ShapeImage();
shapeImg.Img = ShapeImage.ImgToBase64String((Bitmap)Bitmap.FromFile(openFileDialog1.FileName));
create_shape(shapeImg);
}
}
/// <summary>
/// 文本
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_text_Click(object sender, EventArgs e)
{
create_shape(new ShapeText());
}
/// <summary>
/// 条形码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_barcode_Click(object sender, EventArgs e)
{
create_shape(new ShapeBarcode());
}
/// <summary>
/// 删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_delete_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.deleteShapes();
}
}
/// <summary>
/// 组成群组
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_merge_group_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.mergeGroup();
}
}
/// <summary>
/// 取消群组
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_cancel_group_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.cancelGroup();
}
}
/// <summary>
/// 向前1位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_forward_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.forward();
}
}
/// <summary>
/// 移动到最前
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_forwardtofront_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.forwardToFront();
}
}
/// <summary>
/// 往后1位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_backward_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.backward();
}
}
private void btn_wardtoend_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.backwardToEnd();
}
}
/// <summary>
/// 对齐网格
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_align_grid_Click(object sender, EventArgs e)
{
if(this.canvas != null)
{
this.btn_align_grid.Checked = !this.btn_align_grid.Checked; // 更改状态
this.canvas.isAlignDridding = this.btn_align_grid.Checked; // 应用状态
}
}
/// <summary>
/// 放大缩小状态
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_zoom_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.state = new StateCanvasZoom(this.canvas);
}
}
/// <summary>
/// 移动画布的状态
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_move_canvas_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.state = new StateCanvasMove(this.canvas);
}
}
/// <summary>
/// 网格的
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void combo_grid_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (this.canvas != null)
{
switch (e.ClickedItem.Text)
{
case "关闭":
this.canvas.isDrawDridding = false;
break;
case "1":
this.canvas.GriddingInterval = 1;
this.canvas.isDrawDridding = true;
break;
case "2":
this.canvas.GriddingInterval = 2;
this.canvas.isDrawDridding = true;
break;
case "5":
this.canvas.GriddingInterval = 5;
this.canvas.isDrawDridding = true;
break;
default:
break;
}
this.canvas.Refresh(); // 刷新。
}
}
private void btn_page_setting_Click(object sender, EventArgs e)
{
//
IPaperSetting paperSetting;
if (this.canvas.shapes.Paper != null)
{
paperSetting = new FrmPaperSetting(this.canvas.shapes.Paper);
}
else
{
paperSetting = new FrmPaperSetting();
}
// 打开窗口
if (((Form)paperSetting).ShowDialog() == DialogResult.OK)
{
//返回新的纸张设置。
this.canvas.shapes.Paper = paperSetting.GetPaper();
this.canvas.Refresh();
}
}
private void btn_zoom_screen_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.zoomToScreen();
}
}
private void btn_align_top_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.align_top();
}
}
private void btn_align_bottom_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.align_bottom();
}
}
private void btn_align_left_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.align_left();
}
}
private void btn_align_right_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.align_right();
}
}
private void btn_align_center_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.align_center();
}
}
private void btn_align_middle_Click(object sender, EventArgs e)
{
if (this.canvas != null)
{
this.canvas.align_midele();
}
}
private void UserControlToolbox_Resize(object sender, EventArgs e)
{
// 这个会更改属性框的坐标
var left_top_point = new Point(90, 28); // 左上角的坐标
propertyGrid1.Location = left_top_point;
propertyGrid1.Width = this.Width - left_top_point.X - 10;
propertyGrid1.Height = this.Height - left_top_point.Y - 10;
}
private void btn_select_Click(object sender, EventArgs e)
{
// 转成待机模式
this.canvas.SelectShape = null;
this.canvas.state = new StateStandby(this.canvas);
}
}
}

View File

@@ -0,0 +1,484 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btn_page_setting.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_zoom_screen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<data name="btn_select.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_rect.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_roundedrect.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_line.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_ellipse.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_arc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_pie.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_img.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_text.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_barcode.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_delete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_merge_group.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_cancel_group.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_forward.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_forwardtofront.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_backward.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_wardtoend.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="combo_grid.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_align_grid.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_zoom.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btn_move_canvas.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="toolStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>237, 17</value>
</metadata>
<metadata name="errorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>347, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>484, 17</value>
</metadata>
</root>