* (Add) Pixel Editor - Supports and Drain holes: AntiAliasing
* (Add) Pixel Editor - Drawing: Line type and defaults to AntiAliasing
* (Add) Pixel Editor - Drawing: Line thickness to allow hollow shapes
* (Add) Pixel Editor - Drawing: Layer depth, to add pixels at multiple layers at once
* (Add) Pixel Editor: Text writing
This commit is contained in:
Tiago Conceição
2020-08-06 03:43:56 +01:00
parent fc3b789d29
commit f53dc03881
10 changed files with 668 additions and 97 deletions
+10 -2
View File
@@ -1,11 +1,19 @@
# Changelog
## 05/07/2020 - v0.6.4.2
## 06/08/2020 - v0.6.4.3
* (Add) Pixel Editor - Supports and Drain holes: AntiAliasing
* (Add) Pixel Editor - Drawing: Line type and defaults to AntiAliasing
* (Add) Pixel Editor - Drawing: Line thickness to allow hollow shapes
* (Add) Pixel Editor - Drawing: Layer depth, to add pixels at multiple layers at once
* (Add) Pixel Editor: Text writing
## 05/08/2020 - v0.6.4.2
* (Add) Hold "ALT" key when double clicking over items to invert AutoZoom setting, prevent or do zoom in issues or pixels, this will behave as !AutoZoom as long key is held
* (Improvement) Partial island update speed, huge boost performance over large files
## 04/07/2020 - v0.6.4.1
## 04/08/2020 - v0.6.4.1
* (Add) Partial update islands from current working layer and next layer when using pixel editor or island remove
* (Add) Setting: To enable or disable partial update islands
+11 -4
View File
@@ -1330,16 +1330,23 @@ namespace UVtools.Core
switch (operationDrawing.BrushShape)
{
case PixelDrawing.BrushShapeType.Rectangle:
CvInvoke.Rectangle(mat, operationDrawing.Rectangle, new MCvScalar(operationDrawing.Color), -1);
CvInvoke.Rectangle(mat, operationDrawing.Rectangle, new MCvScalar(operationDrawing.Color), operationDrawing.Thickness, operationDrawing.LineType);
break;
case PixelDrawing.BrushShapeType.Circle:
CvInvoke.Circle(mat, operation.Location, operationDrawing.BrushSize / 2,
new MCvScalar(operationDrawing.Color), -1);
new MCvScalar(operationDrawing.Color), operationDrawing.Thickness, operationDrawing.LineType);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
else if (operation.OperationType == PixelOperation.PixelOperationType.Text)
{
var operationText = (PixelText)operation;
var mat = modfiedLayers.GetOrAdd(operation.LayerIndex, u => this[operation.LayerIndex].LayerMat);
CvInvoke.PutText(mat, operationText.Text, operationText.Location, operationText.Font, operationText.FontScale, new MCvScalar(operationText.Color), operationText.Thickness, operationText.LineType, operationText.Mirror);
}
else if (operation.OperationType == PixelOperation.PixelOperationType.Supports)
{
var operationSupport = (PixelSupport)operation;
@@ -1371,7 +1378,7 @@ namespace UVtools.Core
break; // White area end supporting
}
CvInvoke.Circle(mat, operation.Location, radius, new MCvScalar(255), -1);
CvInvoke.Circle(mat, operation.Location, radius, new MCvScalar(255), -1, operationSupport.LineType);
drawnLayers++;
}
}
@@ -1408,7 +1415,7 @@ namespace UVtools.Core
break; // Stop drill drain found!
}
CvInvoke.Circle(mat, operation.Location, radius, new MCvScalar(0), -1);
CvInvoke.Circle(mat, operation.Location, radius, new MCvScalar(0), -1, operationDrainHole.LineType);
drawnLayers++;
}
}
+9 -1
View File
@@ -7,6 +7,7 @@
*/
using System;
using System.Drawing;
using Emgu.CV.CvEnum;
namespace UVtools.Core.PixelEditor
{
@@ -23,6 +24,11 @@ namespace UVtools.Core.PixelEditor
public BrushShapeType BrushShape { get; }
public ushort BrushSize { get; }
public short Thickness { get; }
//public ushort LayersBelow { get; }
//public ushort LayersAbove { get; }
public bool IsAdd { get; }
@@ -30,11 +36,13 @@ namespace UVtools.Core.PixelEditor
public Rectangle Rectangle { get; }
public PixelDrawing(uint layerIndex, Point location, BrushShapeType brushShape, ushort brushSize, bool isAdd) : base(PixelOperationType.Drawing, layerIndex, location)
public PixelDrawing(uint layerIndex, Point location, LineType lineType, BrushShapeType brushShape, ushort brushSize, short thickness, bool isAdd) : base(PixelOperationType.Drawing, layerIndex, location, lineType)
{
BrushShape = brushShape;
BrushSize = brushSize;
Thickness = thickness;
IsAdd = isAdd;
Color = (byte) (isAdd ? 255 : 0);
+9 -2
View File
@@ -6,6 +6,7 @@
* of this license document, but changing it is not allowed.
*/
using System.Drawing;
using Emgu.CV.CvEnum;
namespace UVtools.Core.PixelEditor
{
@@ -14,6 +15,7 @@ namespace UVtools.Core.PixelEditor
public enum PixelOperationType : byte
{
Drawing,
Text,
Supports,
DrainHole,
}
@@ -38,17 +40,22 @@ namespace UVtools.Core.PixelEditor
/// </summary>
public Point Location { get; }
/// <summary>
/// Gets the <see cref="LineType"/> for the draw operation
/// </summary>
public LineType LineType { get; }
/// <summary>
/// Gets the total size of the operation
/// </summary>
public Size Size { get; private protected set; } = Size.Empty;
public PixelOperation(PixelOperationType operationType, uint layerIndex, Point location)
public PixelOperation(PixelOperationType operationType, uint layerIndex, Point location, LineType lineType = LineType.AntiAlias)
{
OperationType = operationType;
Location = location;
LayerIndex = layerIndex;
LineType = lineType;
}
}
}
+45
View File
@@ -0,0 +1,45 @@
/*
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
using System;
using System.Drawing;
using Emgu.CV;
using Emgu.CV.CvEnum;
namespace UVtools.Core.PixelEditor
{
public class PixelText : PixelOperation
{
public FontFace Font { get; }
public double FontScale { get; }
public ushort Thickness { get; }
public string Text { get; }
public bool Mirror { get; }
public bool IsAdd { get; }
public byte Color { get; }
public Rectangle Rectangle { get; }
public PixelText(uint layerIndex, Point location, LineType lineType, FontFace font, double fontScale, ushort thickness, string text, bool mirror, bool isAdd) : base(PixelOperationType.Text, layerIndex, location, lineType)
{
Font = font;
FontScale = fontScale;
Thickness = thickness;
Text = text;
Mirror = mirror;
IsAdd = isAdd;
Color = (byte) (isAdd ? 255 : 0);
int baseLine = 0;
Size = CvInvoke.GetTextSize(text, font, fontScale, thickness, ref baseLine);
Rectangle = new Rectangle(location, Size);
}
}
}
+3 -3
View File
@@ -10,12 +10,12 @@
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
<PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl>
<Description>MSLA/DLP, file analysis, repair, conversion and manipulation</Description>
<Version>0.6.4.2</Version>
<Version>0.6.4.3</Version>
<Copyright>Copyright © 2020 PTRTECH</Copyright>
<PackageIcon>UVtools.png</PackageIcon>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyVersion>0.6.4.2</AssemblyVersion>
<FileVersion>0.6.4.2</FileVersion>
<AssemblyVersion>0.6.4.3</AssemblyVersion>
<FileVersion>0.6.4.3</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+471 -33
View File
@@ -164,13 +164,42 @@
this.btnPixelHistoryClear = new System.Windows.Forms.ToolStripButton();
this.tabControlPixelEditor = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.label29 = new System.Windows.Forms.Label();
this.label28 = new System.Windows.Forms.Label();
this.nmPixelEditorDrawingThickness = new System.Windows.Forms.NumericUpDown();
this.label27 = new System.Windows.Forms.Label();
this.cbPixelEditorDrawingLineType = new System.Windows.Forms.ComboBox();
this.label17 = new System.Windows.Forms.Label();
this.nmPixelEditorDrawingLayersAbove = new System.Windows.Forms.NumericUpDown();
this.label16 = new System.Windows.Forms.Label();
this.nmPixelEditorDrawingLayersBelow = new System.Windows.Forms.NumericUpDown();
this.label15 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.nmPixelEditorBrushSize = new System.Windows.Forms.NumericUpDown();
this.nmPixelEditorDrawingBrushSize = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.panel3 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cbPixelEditorBrushShape = new System.Windows.Forms.ComboBox();
this.cbPixelEditorDrawingBrushShape = new System.Windows.Forms.ComboBox();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.label21 = new System.Windows.Forms.Label();
this.cbPixelEditorTextLineType = new System.Windows.Forms.ComboBox();
this.cbPixelEditorTextMirror = new System.Windows.Forms.CheckBox();
this.label26 = new System.Windows.Forms.Label();
this.nmPixelEditorTextThickness = new System.Windows.Forms.NumericUpDown();
this.label25 = new System.Windows.Forms.Label();
this.tbPixelEditorTextText = new System.Windows.Forms.TextBox();
this.label18 = new System.Windows.Forms.Label();
this.nmPixelEditorTextLayersAbove = new System.Windows.Forms.NumericUpDown();
this.label19 = new System.Windows.Forms.Label();
this.nmPixelEditorTextLayersBelow = new System.Windows.Forms.NumericUpDown();
this.label20 = new System.Windows.Forms.Label();
this.nmPixelEditorTextFontScale = new System.Windows.Forms.NumericUpDown();
this.label22 = new System.Windows.Forms.Label();
this.panel6 = new System.Windows.Forms.Panel();
this.label23 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.cbPixelEditorTextFontFace = new System.Windows.Forms.ComboBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.label10 = new System.Windows.Forms.Label();
this.nmPixelEditorSupportsBaseDiameter = new System.Windows.Forms.NumericUpDown();
@@ -238,8 +267,17 @@
this.tsPixelEditorHistory.SuspendLayout();
this.tabControlPixelEditor.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorBrushSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingThickness)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingLayersAbove)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingLayersBelow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingBrushSize)).BeginInit();
this.panel3.SuspendLayout();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextThickness)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextLayersAbove)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextLayersBelow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextFontScale)).BeginInit();
this.panel6.SuspendLayout();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorSupportsBaseDiameter)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorSupportsPillarDiameter)).BeginInit();
@@ -1624,6 +1662,7 @@
// tabControlPixelEditor
//
this.tabControlPixelEditor.Controls.Add(this.tabPage1);
this.tabControlPixelEditor.Controls.Add(this.tabPage4);
this.tabControlPixelEditor.Controls.Add(this.tabPage2);
this.tabControlPixelEditor.Controls.Add(this.tabPage3);
this.tabControlPixelEditor.Dock = System.Windows.Forms.DockStyle.Top;
@@ -1635,12 +1674,22 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.label29);
this.tabPage1.Controls.Add(this.label28);
this.tabPage1.Controls.Add(this.nmPixelEditorDrawingThickness);
this.tabPage1.Controls.Add(this.label27);
this.tabPage1.Controls.Add(this.cbPixelEditorDrawingLineType);
this.tabPage1.Controls.Add(this.label17);
this.tabPage1.Controls.Add(this.nmPixelEditorDrawingLayersAbove);
this.tabPage1.Controls.Add(this.label16);
this.tabPage1.Controls.Add(this.nmPixelEditorDrawingLayersBelow);
this.tabPage1.Controls.Add(this.label15);
this.tabPage1.Controls.Add(this.label6);
this.tabPage1.Controls.Add(this.nmPixelEditorBrushSize);
this.tabPage1.Controls.Add(this.nmPixelEditorDrawingBrushSize);
this.tabPage1.Controls.Add(this.label3);
this.tabPage1.Controls.Add(this.panel3);
this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.cbPixelEditorBrushShape);
this.tabPage1.Controls.Add(this.cbPixelEditorDrawingBrushShape);
this.tabPage1.Location = new System.Drawing.Point(4, 27);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
@@ -1649,35 +1698,153 @@
this.tabPage1.Text = "Drawing";
this.tabPage1.UseVisualStyleBackColor = true;
//
// label29
//
this.label29.AutoSize = true;
this.label29.Location = new System.Drawing.Point(7, 163);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(80, 18);
this.label29.TabIndex = 34;
this.label29.Text = "Thickness:";
//
// label28
//
this.label28.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(338, 163);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(23, 18);
this.label28.TabIndex = 33;
this.label28.Text = "px";
//
// nmPixelEditorDrawingThickness
//
this.nmPixelEditorDrawingThickness.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorDrawingThickness.Location = new System.Drawing.Point(108, 160);
this.nmPixelEditorDrawingThickness.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.nmPixelEditorDrawingThickness.Minimum = new decimal(new int[] {
1,
0,
0,
-2147483648});
this.nmPixelEditorDrawingThickness.Name = "nmPixelEditorDrawingThickness";
this.nmPixelEditorDrawingThickness.Size = new System.Drawing.Size(224, 24);
this.nmPixelEditorDrawingThickness.TabIndex = 32;
this.nmPixelEditorDrawingThickness.Value = new decimal(new int[] {
1,
0,
0,
-2147483648});
//
// label27
//
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(7, 70);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(70, 18);
this.label27.TabIndex = 31;
this.label27.Text = "Line type:";
//
// cbPixelEditorDrawingLineType
//
this.cbPixelEditorDrawingLineType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbPixelEditorDrawingLineType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbPixelEditorDrawingLineType.FormattingEnabled = true;
this.cbPixelEditorDrawingLineType.Location = new System.Drawing.Point(108, 66);
this.cbPixelEditorDrawingLineType.Name = "cbPixelEditorDrawingLineType";
this.cbPixelEditorDrawingLineType.Size = new System.Drawing.Size(258, 26);
this.cbPixelEditorDrawingLineType.TabIndex = 30;
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(268, 217);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(49, 18);
this.label17.TabIndex = 11;
this.label17.Text = "Above";
//
// nmPixelEditorDrawingLayersAbove
//
this.nmPixelEditorDrawingLayersAbove.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorDrawingLayersAbove.Location = new System.Drawing.Point(259, 190);
this.nmPixelEditorDrawingLayersAbove.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.nmPixelEditorDrawingLayersAbove.Name = "nmPixelEditorDrawingLayersAbove";
this.nmPixelEditorDrawingLayersAbove.Size = new System.Drawing.Size(73, 24);
this.nmPixelEditorDrawingLayersAbove.TabIndex = 10;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(114, 217);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(49, 18);
this.label16.TabIndex = 9;
this.label16.Text = "Below";
//
// nmPixelEditorDrawingLayersBelow
//
this.nmPixelEditorDrawingLayersBelow.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorDrawingLayersBelow.Location = new System.Drawing.Point(108, 190);
this.nmPixelEditorDrawingLayersBelow.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.nmPixelEditorDrawingLayersBelow.Name = "nmPixelEditorDrawingLayersBelow";
this.nmPixelEditorDrawingLayersBelow.Size = new System.Drawing.Size(73, 24);
this.nmPixelEditorDrawingLayersBelow.TabIndex = 8;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(7, 193);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(96, 18);
this.label15.TabIndex = 7;
this.label15.Text = "Layers depth:";
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(338, 101);
this.label6.Location = new System.Drawing.Point(338, 133);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(28, 18);
this.label6.TabIndex = 6;
this.label6.Text = "px²";
//
// nmPixelEditorBrushSize
// nmPixelEditorDrawingBrushSize
//
this.nmPixelEditorBrushSize.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.nmPixelEditorDrawingBrushSize.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorBrushSize.Location = new System.Drawing.Point(108, 98);
this.nmPixelEditorBrushSize.Maximum = new decimal(new int[] {
this.nmPixelEditorDrawingBrushSize.Location = new System.Drawing.Point(108, 130);
this.nmPixelEditorDrawingBrushSize.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.nmPixelEditorBrushSize.Minimum = new decimal(new int[] {
this.nmPixelEditorDrawingBrushSize.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.nmPixelEditorBrushSize.Name = "nmPixelEditorBrushSize";
this.nmPixelEditorBrushSize.Size = new System.Drawing.Size(224, 24);
this.nmPixelEditorBrushSize.TabIndex = 5;
this.nmPixelEditorBrushSize.Value = new decimal(new int[] {
this.nmPixelEditorDrawingBrushSize.Name = "nmPixelEditorDrawingBrushSize";
this.nmPixelEditorDrawingBrushSize.Size = new System.Drawing.Size(224, 24);
this.nmPixelEditorDrawingBrushSize.TabIndex = 5;
this.nmPixelEditorDrawingBrushSize.Value = new decimal(new int[] {
1,
0,
0,
@@ -1686,7 +1853,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(16, 101);
this.label3.Location = new System.Drawing.Point(7, 133);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(84, 18);
this.label3.TabIndex = 4;
@@ -1715,23 +1882,254 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 70);
this.label2.Location = new System.Drawing.Point(7, 102);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(95, 18);
this.label2.TabIndex = 2;
this.label2.Text = "Brush shape:";
//
// cbPixelEditorBrushShape
// cbPixelEditorDrawingBrushShape
//
this.cbPixelEditorBrushShape.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.cbPixelEditorDrawingBrushShape.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbPixelEditorBrushShape.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbPixelEditorBrushShape.FormattingEnabled = true;
this.cbPixelEditorBrushShape.Location = new System.Drawing.Point(108, 66);
this.cbPixelEditorBrushShape.Name = "cbPixelEditorBrushShape";
this.cbPixelEditorBrushShape.Size = new System.Drawing.Size(258, 26);
this.cbPixelEditorBrushShape.TabIndex = 0;
this.cbPixelEditorBrushShape.SelectedIndexChanged += new System.EventHandler(this.EventSelectedIndexChanged);
this.cbPixelEditorDrawingBrushShape.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbPixelEditorDrawingBrushShape.FormattingEnabled = true;
this.cbPixelEditorDrawingBrushShape.Location = new System.Drawing.Point(108, 98);
this.cbPixelEditorDrawingBrushShape.Name = "cbPixelEditorDrawingBrushShape";
this.cbPixelEditorDrawingBrushShape.Size = new System.Drawing.Size(258, 26);
this.cbPixelEditorDrawingBrushShape.TabIndex = 0;
this.cbPixelEditorDrawingBrushShape.SelectedIndexChanged += new System.EventHandler(this.EventSelectedIndexChanged);
//
// tabPage4
//
this.tabPage4.Controls.Add(this.label21);
this.tabPage4.Controls.Add(this.cbPixelEditorTextLineType);
this.tabPage4.Controls.Add(this.cbPixelEditorTextMirror);
this.tabPage4.Controls.Add(this.label26);
this.tabPage4.Controls.Add(this.nmPixelEditorTextThickness);
this.tabPage4.Controls.Add(this.label25);
this.tabPage4.Controls.Add(this.tbPixelEditorTextText);
this.tabPage4.Controls.Add(this.label18);
this.tabPage4.Controls.Add(this.nmPixelEditorTextLayersAbove);
this.tabPage4.Controls.Add(this.label19);
this.tabPage4.Controls.Add(this.nmPixelEditorTextLayersBelow);
this.tabPage4.Controls.Add(this.label20);
this.tabPage4.Controls.Add(this.nmPixelEditorTextFontScale);
this.tabPage4.Controls.Add(this.label22);
this.tabPage4.Controls.Add(this.panel6);
this.tabPage4.Controls.Add(this.label24);
this.tabPage4.Controls.Add(this.cbPixelEditorTextFontFace);
this.tabPage4.Location = new System.Drawing.Point(4, 27);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(372, 291);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "Text";
this.tabPage4.UseVisualStyleBackColor = true;
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(7, 70);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(70, 18);
this.label21.TabIndex = 29;
this.label21.Text = "Line type:";
//
// cbPixelEditorTextLineType
//
this.cbPixelEditorTextLineType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbPixelEditorTextLineType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbPixelEditorTextLineType.FormattingEnabled = true;
this.cbPixelEditorTextLineType.Location = new System.Drawing.Point(109, 66);
this.cbPixelEditorTextLineType.Name = "cbPixelEditorTextLineType";
this.cbPixelEditorTextLineType.Size = new System.Drawing.Size(257, 26);
this.cbPixelEditorTextLineType.TabIndex = 28;
//
// cbPixelEditorTextMirror
//
this.cbPixelEditorTextMirror.AutoSize = true;
this.cbPixelEditorTextMirror.Location = new System.Drawing.Point(109, 190);
this.cbPixelEditorTextMirror.Name = "cbPixelEditorTextMirror";
this.cbPixelEditorTextMirror.Size = new System.Drawing.Size(137, 22);
this.cbPixelEditorTextMirror.TabIndex = 27;
this.cbPixelEditorTextMirror.Text = "Flip text vertically";
this.cbPixelEditorTextMirror.UseVisualStyleBackColor = true;
//
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(207, 133);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(80, 18);
this.label26.TabIndex = 26;
this.label26.Text = "Thickness:";
//
// nmPixelEditorTextThickness
//
this.nmPixelEditorTextThickness.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorTextThickness.Location = new System.Drawing.Point(293, 130);
this.nmPixelEditorTextThickness.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.nmPixelEditorTextThickness.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.nmPixelEditorTextThickness.Name = "nmPixelEditorTextThickness";
this.nmPixelEditorTextThickness.Size = new System.Drawing.Size(73, 24);
this.nmPixelEditorTextThickness.TabIndex = 25;
this.nmPixelEditorTextThickness.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(8, 163);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(40, 18);
this.label25.TabIndex = 24;
this.label25.Text = "Text:";
//
// tbPixelEditorTextText
//
this.tbPixelEditorTextText.Location = new System.Drawing.Point(109, 160);
this.tbPixelEditorTextText.Name = "tbPixelEditorTextText";
this.tbPixelEditorTextText.Size = new System.Drawing.Size(257, 24);
this.tbPixelEditorTextText.TabIndex = 23;
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(302, 245);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(49, 18);
this.label18.TabIndex = 22;
this.label18.Text = "Above";
//
// nmPixelEditorTextLayersAbove
//
this.nmPixelEditorTextLayersAbove.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorTextLayersAbove.Location = new System.Drawing.Point(293, 218);
this.nmPixelEditorTextLayersAbove.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.nmPixelEditorTextLayersAbove.Name = "nmPixelEditorTextLayersAbove";
this.nmPixelEditorTextLayersAbove.Size = new System.Drawing.Size(73, 24);
this.nmPixelEditorTextLayersAbove.TabIndex = 21;
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(115, 245);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(49, 18);
this.label19.TabIndex = 20;
this.label19.Text = "Below";
//
// nmPixelEditorTextLayersBelow
//
this.nmPixelEditorTextLayersBelow.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorTextLayersBelow.Location = new System.Drawing.Point(109, 218);
this.nmPixelEditorTextLayersBelow.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.nmPixelEditorTextLayersBelow.Name = "nmPixelEditorTextLayersBelow";
this.nmPixelEditorTextLayersBelow.Size = new System.Drawing.Size(73, 24);
this.nmPixelEditorTextLayersBelow.TabIndex = 19;
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(7, 221);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(96, 18);
this.label20.TabIndex = 18;
this.label20.Text = "Layers depth:";
//
// nmPixelEditorTextFontScale
//
this.nmPixelEditorTextFontScale.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nmPixelEditorTextFontScale.DecimalPlaces = 2;
this.nmPixelEditorTextFontScale.Location = new System.Drawing.Point(109, 130);
this.nmPixelEditorTextFontScale.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.nmPixelEditorTextFontScale.Name = "nmPixelEditorTextFontScale";
this.nmPixelEditorTextFontScale.Size = new System.Drawing.Size(73, 24);
this.nmPixelEditorTextFontScale.TabIndex = 16;
this.nmPixelEditorTextFontScale.Value = new decimal(new int[] {
2,
0,
0,
0});
//
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(7, 133);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(81, 18);
this.label22.TabIndex = 15;
this.label22.Text = "Font scale:";
//
// panel6
//
this.panel6.BackColor = System.Drawing.Color.WhiteSmoke;
this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel6.Controls.Add(this.label23);
this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
this.panel6.Location = new System.Drawing.Point(3, 3);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(366, 57);
this.panel6.TabIndex = 14;
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(3, 9);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(299, 36);
this.label23.TabIndex = 1;
this.label23.Text = "Right click to add white pixels text\r\nShift + Right click to remove white pixels " +
"text";
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(7, 102);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(74, 18);
this.label24.TabIndex = 13;
this.label24.Text = "Font face:";
//
// cbPixelEditorTextFontFace
//
this.cbPixelEditorTextFontFace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbPixelEditorTextFontFace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbPixelEditorTextFontFace.FormattingEnabled = true;
this.cbPixelEditorTextFontFace.Location = new System.Drawing.Point(109, 98);
this.cbPixelEditorTextFontFace.Name = "cbPixelEditorTextFontFace";
this.cbPixelEditorTextFontFace.Size = new System.Drawing.Size(257, 26);
this.cbPixelEditorTextFontFace.TabIndex = 12;
//
// tabPage2
//
@@ -1790,7 +2188,7 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 128);
this.label11.Location = new System.Drawing.Point(6, 129);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(161, 18);
this.label11.TabIndex = 12;
@@ -1833,7 +2231,7 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(6, 98);
this.label9.Location = new System.Drawing.Point(6, 99);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(159, 18);
this.label9.TabIndex = 9;
@@ -1876,7 +2274,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 68);
this.label5.Location = new System.Drawing.Point(6, 69);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(144, 18);
this.label5.TabIndex = 6;
@@ -1954,7 +2352,7 @@
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(4, 68);
this.label14.Location = new System.Drawing.Point(4, 69);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(140, 18);
this.label14.TabIndex = 12;
@@ -2290,9 +2688,20 @@
this.tabControlPixelEditor.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorBrushSize)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingThickness)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingLayersAbove)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingLayersBelow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorDrawingBrushSize)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextThickness)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextLayersAbove)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextLayersBelow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorTextFontScale)).EndInit();
this.panel6.ResumeLayout(false);
this.panel6.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nmPixelEditorSupportsBaseDiameter)).EndInit();
@@ -2428,11 +2837,11 @@
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.ToolStrip tsPixelEditorHistory;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cbPixelEditorBrushShape;
private System.Windows.Forms.ComboBox cbPixelEditorDrawingBrushShape;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown nmPixelEditorBrushSize;
private System.Windows.Forms.NumericUpDown nmPixelEditorDrawingBrushSize;
private System.Windows.Forms.ToolStripLabel lbPixelHistoryOperations;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label4;
@@ -2501,6 +2910,35 @@
private System.Windows.Forms.ToolStripButton btnIssueGroup;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator23;
private System.Windows.Forms.ToolStripButton btnIssueResort;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.NumericUpDown nmPixelEditorDrawingLayersAbove;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.NumericUpDown nmPixelEditorDrawingLayersBelow;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.NumericUpDown nmPixelEditorTextLayersAbove;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.NumericUpDown nmPixelEditorTextLayersBelow;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.NumericUpDown nmPixelEditorTextFontScale;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.ComboBox cbPixelEditorTextFontFace;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.TextBox tbPixelEditorTextText;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.NumericUpDown nmPixelEditorTextThickness;
private System.Windows.Forms.CheckBox cbPixelEditorTextMirror;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.ComboBox cbPixelEditorTextLineType;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.ComboBox cbPixelEditorDrawingLineType;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.Label label28;
private System.Windows.Forms.NumericUpDown nmPixelEditorDrawingThickness;
}
}
+99 -29
View File
@@ -205,10 +205,26 @@ namespace UVtools.GUI
foreach (PixelDrawing.BrushShapeType brushShape in (PixelDrawing.BrushShapeType[])Enum.GetValues(
typeof(PixelDrawing.BrushShapeType)))
{
cbPixelEditorBrushShape.Items.Add(brushShape);
cbPixelEditorDrawingBrushShape.Items.Add(brushShape);
}
cbPixelEditorDrawingBrushShape.SelectedIndex = 0;
cbPixelEditorBrushShape.SelectedIndex = 0;
foreach (LineType lineType in (LineType[])Enum.GetValues(
typeof(LineType)))
{
if(lineType == LineType.Filled) continue;
cbPixelEditorDrawingLineType.Items.Add(lineType);
cbPixelEditorTextLineType.Items.Add(lineType);
}
cbPixelEditorDrawingLineType.SelectedItem = LineType.AntiAlias;
cbPixelEditorTextLineType.SelectedItem = LineType.AntiAlias;
foreach (FontFace font in (FontFace[])Enum.GetValues(
typeof(FontFace)))
{
cbPixelEditorTextFontFace.Items.Add(font);
}
cbPixelEditorTextFontFace.SelectedIndex = 0;
tbLayer.MouseWheel += TbLayerOnMouseWheel;
@@ -2606,15 +2622,24 @@ namespace UVtools.GUI
switch (operationDrawing.BrushShape)
{
case PixelDrawing.BrushShapeType.Rectangle:
CvInvoke.Rectangle(ActualLayerImageBgr, operationDrawing.Rectangle, new MCvScalar(color.B, color.G, color.R), -1);
CvInvoke.Rectangle(ActualLayerImageBgr, operationDrawing.Rectangle, new MCvScalar(color.B, color.G, color.R), operationDrawing.Thickness, operationDrawing.LineType);
break;
case PixelDrawing.BrushShapeType.Circle:
CvInvoke.Circle(ActualLayerImageBgr, operation.Location, operationDrawing.BrushSize / 2, new MCvScalar(color.B, color.G, color.R), -1);
CvInvoke.Circle(ActualLayerImageBgr, operation.Location, operationDrawing.BrushSize / 2, new MCvScalar(color.B, color.G, color.R), operationDrawing.Thickness, operationDrawing.LineType);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
else if (operation.OperationType == PixelOperation.PixelOperationType.Text)
{
var operationText = (PixelText)operation;
var color = operationText.IsAdd
? Settings.Default.PixelEditorAddPixelColor
: Settings.Default.PixelEditorRemovePixelColor;
CvInvoke.PutText(ActualLayerImageBgr, operationText.Text, operationText.Location, operationText.Font, operationText.FontScale, new MCvScalar(color.B, color.G, color.R), operationText.Thickness, operationText.LineType, operationText.Mirror);
}
else if (operation.OperationType == PixelOperation.PixelOperationType.Supports)
{
var operationSupport = (PixelSupport)operation;
@@ -2723,16 +2748,16 @@ namespace UVtools.GUI
return;
}
if (ReferenceEquals(sender, cbPixelEditorBrushShape))
if (ReferenceEquals(sender, cbPixelEditorDrawingBrushShape))
{
if (cbPixelEditorBrushShape.SelectedIndex == (int) PixelDrawing.BrushShapeType.Rectangle)
if (cbPixelEditorDrawingBrushShape.SelectedIndex == (int) PixelDrawing.BrushShapeType.Rectangle)
{
nmPixelEditorBrushSize.Minimum = PixelDrawing.MinRectangleBrush;
nmPixelEditorDrawingBrushSize.Minimum = PixelDrawing.MinRectangleBrush;
return;
}
if (cbPixelEditorBrushShape.SelectedIndex == (int)PixelDrawing.BrushShapeType.Circle)
if (cbPixelEditorDrawingBrushShape.SelectedIndex == (int)PixelDrawing.BrushShapeType.Circle)
{
nmPixelEditorBrushSize.Minimum = PixelDrawing.MinCircleBrush;
nmPixelEditorDrawingBrushSize.Minimum = PixelDrawing.MinCircleBrush;
return;
}
return;
@@ -2937,35 +2962,77 @@ namespace UVtools.GUI
if (tabControlPixelEditor.SelectedIndex == (int) PixelOperation.PixelOperationType.Drawing)
{
LineType lineType = (LineType)cbPixelEditorDrawingLineType.SelectedItem;
PixelDrawing.BrushShapeType shapeType =
(PixelDrawing.BrushShapeType) cbPixelEditorBrushShape.SelectedIndex;
operation = new PixelDrawing(ActualLayer, new Point(x, y),
shapeType, (ushort) nmPixelEditorBrushSize.Value, isAdd);
(PixelDrawing.BrushShapeType) cbPixelEditorDrawingBrushShape.SelectedIndex;
if (PixelHistory.Contains(operation)) return;
ushort brushSize = (ushort) nmPixelEditorDrawingBrushSize.Value;
short thickness = (short) (nmPixelEditorDrawingThickness.Value == 0 ? 1 : nmPixelEditorDrawingThickness.Value);
using (var gfx = Graphics.FromImage(bmp))
uint minLayer = (uint) Math.Max(0, ActualLayer - nmPixelEditorDrawingLayersBelow.Value);
uint maxLayer = (uint) Math.Min(SlicerFile.LayerCount-1, ActualLayer+nmPixelEditorDrawingLayersAbove.Value);
for (uint layerIndex = minLayer; layerIndex <= maxLayer; layerIndex++)
{
int shiftPos = (int)nmPixelEditorBrushSize.Value / 2;
gfx.SmoothingMode = SmoothingMode.HighSpeed;
operation = new PixelDrawing(layerIndex, new Point(x, y), lineType,
shapeType, brushSize, thickness, isAdd);
var color = isAdd ? Settings.Default.PixelEditorAddPixelColor : Settings.Default.PixelEditorRemovePixelColor;
SolidBrush brush = new SolidBrush(color);
if (PixelHistory.Contains(operation)) continue;
PixelHistory.Add(operation);
switch (shapeType)
if (layerIndex == ActualLayer)
{
case PixelDrawing.BrushShapeType.Rectangle:
gfx.FillRectangle(brush, Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), (int)nmPixelEditorBrushSize.Value, (int)nmPixelEditorBrushSize.Value);
break;
case PixelDrawing.BrushShapeType.Circle:
gfx.FillEllipse(brush, Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), (int)nmPixelEditorBrushSize.Value, (int)nmPixelEditorBrushSize.Value);
break;
default:
throw new ArgumentOutOfRangeException();
}
using (var gfx = Graphics.FromImage(bmp))
{
int shiftPos = brushSize / 2;
gfx.SmoothingMode = SmoothingMode.HighSpeed;
var color = isAdd ? Settings.Default.PixelEditorAddPixelColor : Settings.Default.PixelEditorRemovePixelColor;
if (lineType == LineType.AntiAlias && brushSize > 1)
{
gfx.SmoothingMode = SmoothingMode.AntiAlias;
}
switch (shapeType)
{
case PixelDrawing.BrushShapeType.Rectangle:
if (thickness > 0)
gfx.DrawRectangle(new Pen(color, thickness), Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), (int)nmPixelEditorDrawingBrushSize.Value, (int)nmPixelEditorDrawingBrushSize.Value);
else
gfx.FillRectangle(new SolidBrush(color), Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), (int)nmPixelEditorDrawingBrushSize.Value, (int)nmPixelEditorDrawingBrushSize.Value);
break;
case PixelDrawing.BrushShapeType.Circle:
if (thickness > 0)
gfx.DrawEllipse(new Pen(color, thickness), Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), (int)nmPixelEditorDrawingBrushSize.Value, (int)nmPixelEditorDrawingBrushSize.Value);
else
gfx.FillEllipse(new SolidBrush(color), Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), (int)nmPixelEditorDrawingBrushSize.Value, (int)nmPixelEditorDrawingBrushSize.Value);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}
}
else if (tabControlPixelEditor.SelectedIndex == (int)PixelOperation.PixelOperationType.Text)
{
if (string.IsNullOrEmpty(tbPixelEditorTextText.Text) || nmPixelEditorTextFontScale.Value < 0.2m) return;
LineType lineType = (LineType)cbPixelEditorTextLineType.SelectedItem;
FontFace fontFace = (FontFace)cbPixelEditorTextFontFace.SelectedItem;
uint minLayer = (uint)Math.Max(0, ActualLayer - nmPixelEditorTextLayersBelow.Value);
uint maxLayer = (uint)Math.Min(SlicerFile.LayerCount - 1, ActualLayer + nmPixelEditorTextLayersAbove.Value);
for (uint layerIndex = minLayer; layerIndex <= maxLayer; layerIndex++)
{
operation = new PixelText(layerIndex, new Point(x, y), lineType,
fontFace, (double) nmPixelEditorTextFontScale.Value, (ushort) nmPixelEditorTextThickness.Value, tbPixelEditorTextText.Text, cbPixelEditorTextMirror.Checked, isAdd);
if (PixelHistory.Contains(operation)) continue;
PixelHistory.Add(operation);
}
ShowLayer();
return;
}
else if (tabControlPixelEditor.SelectedIndex == (int) PixelOperation.PixelOperationType.Supports)
{
if (ActualLayer == 0) return;
@@ -2973,6 +3040,7 @@ namespace UVtools.GUI
(byte) nmPixelEditorSupportsTipDiameter.Value, (byte)nmPixelEditorSupportsPillarDiameter.Value, (byte)nmPixelEditorSupportsBaseDiameter.Value);
if (PixelHistory.Contains(operation)) return;
PixelHistory.Add(operation);
SolidBrush brush = new SolidBrush(Settings.Default.PixelEditorSupportColor);
using (var gfx = Graphics.FromImage(bmp))
@@ -2988,6 +3056,7 @@ namespace UVtools.GUI
operation = new PixelDrainHole(ActualLayer, new Point(x, y), (byte)nmPixelEditorDrainHoleDiameter.Value);
if (PixelHistory.Contains(operation)) return;
PixelHistory.Add(operation);
SolidBrush brush = new SolidBrush(Settings.Default.PixelEditorDrainHoleColor);
using (var gfx = Graphics.FromImage(bmp))
@@ -3002,7 +3071,7 @@ namespace UVtools.GUI
throw new NotImplementedException("Missing pixel operation");
}
PixelHistory.Add(operation);
pbLayer.Invalidate();
//pbLayer.Update();
@@ -3410,6 +3479,7 @@ namespace UVtools.GUI
foreach (var item in PixelHistory.Items)
{
if (item.OperationType != PixelOperation.PixelOperationType.Drawing &&
item.OperationType != PixelOperation.PixelOperationType.Text &&
item.OperationType != PixelOperation.PixelOperationType.Supports) continue;
if (whiteListLayers.Contains(item.LayerIndex)) continue;
whiteListLayers.Add(item.LayerIndex);
+9 -21
View File
@@ -129,6 +129,12 @@
<metadata name="tsLayer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>201, 17</value>
</metadata>
<metadata name="tsThumbnails.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>291, 17</value>
</metadata>
<metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>649, 17</value>
</metadata>
<metadata name="tsGCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>551, 17</value>
</metadata>
@@ -152,7 +158,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk
FAAAAk1TRnQBSQFMAgEBBgEAAWABCAFgAQgBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
FAAAAk1TRnQBSQFMAgEBBgEAAbgBCAG4AQgBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIC4AAxgBIgMwAUsDMAFMAzIBUDMAAQEDJAE2AysBQqwAAyIBMQNWAbkDXQHi
AwAB/wMAAf8BKgEtASgB/gNTAawDTQGVAwABARgAAwkBDAMzAVIDUAGdA1cB6AMAAf4DKwH8Ay8BSqQA
AyEBMANZAewBKwEuASkB+gNRAfcDUgH0A1MB8QNIAfYDQQH5AwAB/wNPAZsDAAEBCAADFQEdAz8BbgNV
@@ -175,7 +181,7 @@
AdMDRwGDAywBRAMIAQsEAAMRARcDWQHEAwAB/wNaAdMDCwEPgAADBwEJA1UBtAMJAQwEAANBAXMDKgFB
A0IBdgM8AWcDUQGnA1oBygNbAdYDJAE2Ax8BLRwAAyoBQAM+AfgDWAHAAx8BLAM4AVwDUAGaA1oB2AMA
Af4DAAH/AwAB/wMAAf8DVQG3hAADAQECA1MBrAMOARMDOwFlBAADMAFNAwcBCQMEAQUwAAM0AVUDKwH8
AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/Az4B/QNcAdQDSAGHiAADPwFuAwYBCAMxAU8DAwEEA1MBsDwA
AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/A0AB/QNcAdQDSAGHiAADPwFuAwYBCAMxAU8DAwEEA1MBsDwA
Az8BbQMAAf8DAAH/A04B8ANWAbkDRgGAAy4BRwMLAQ+QAAMxAU8DAQECTAADKwFDAx8BLAMBAQKoAAMH
AQkDNwFaA0gBhANTAawDUwGsA0gBhAM3AVoDBwEJFAADUAGjA1IBqQNSAakDUgGpA1IBqQNSAakDUgGp
A1IBqQNSAakDUgGpA1IBqQNSAakDUgGpA1ABo1wAAxUBHQFCAlkB9QFRAm0B9wNDAXcDWwHIAkIBWQH1
@@ -200,7 +206,7 @@
BAADUgGpAzQBVQM0AVUgAAM0AVUDNAFVA1IBqQgAA0oBiwMAAf8DAAH/A08BnAQAA00BlQMAAf8DVAGr
CAADTwGcAwAB/wMAAf8DSgGLBAADUQGgAQABzAH3Af8BAAHMAfcB/wEAAcwB9wH/AQABzAH3Af8DQwF3
CAADSgGNAgAB7AH/AgAB7AH/AgAB7wH/AgAB7AH/AgAB7AH/AgAB7QH/AVICUwGoA1IBqAMAAf8DAAH/
AwAB/wM7AfcDEwH9A1ABnwsAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wNSAagEAANSAakDNAFVAzQBVQNG
AwAB/wNMAfcDHgH9A1ABnwsAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wNSAagEAANSAakDNAFVAzQBVQNG
AYADUgGpA1IBqQNSAakDUgGpA1IBqQNSAakDRQF/AzQBVQM0AVUDUgGpBAADUQGiAwAB/wMAAf8DSQGJ
CAADLwFKAwAB/wNUAe4MAANJAYkDAAH/AwAB/wNRAaIDAAEBAT8CQAFvAT4CXAH4AQABzQH3Af8BAAHN
AfcB/wMSARgIAAMBAQIDRgF+AlIBXQHwAgAB7gH/AgAB7gH/AkABqAH9AUUCRgF+AwMBBANSAagDAAH/
@@ -242,24 +248,6 @@
AfwBPws=
</value>
</data>
<metadata name="tsThumbnails.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>291, 17</value>
</metadata>
<metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>649, 17</value>
</metadata>
<metadata name="tsGCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>551, 17</value>
</metadata>
<metadata name="tsPixelEditorHistory.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1155, 17</value>
</metadata>
<metadata name="tsLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1423, 17</value>
</metadata>
<metadata name="toolTipInformation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>863, 17</value>
</metadata>
<metadata name="toolTipInformation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>863, 17</value>
</metadata>
+2 -2
View File
@@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.4.2")]
[assembly: AssemblyFileVersion("0.6.4.2")]
[assembly: AssemblyVersion("0.6.4.3")]
[assembly: AssemblyFileVersion("0.6.4.3")]