Add configurable crosshair lines

This commit is contained in:
Tiago Conceição
2020-09-02 23:39:45 +01:00
parent 739eca77fe
commit 9461bc1c04
8 changed files with 312 additions and 92 deletions
+16 -6
View File
@@ -144,10 +144,10 @@
<setting name="DefaultOpenFileExtension" serializeAs="String">
<value>0</value>
</setting>
<setting name="DefaultCrosshairFade" serializeAs="String">
<setting name="CrosshairFadeLevel" serializeAs="String">
<value>5</value>
</setting>
<setting name="DefaultAutoZoomLock" serializeAs="String">
<setting name="AutoZoomLockLevel" serializeAs="String">
<value>7</value>
</setting>
<setting name="PixelEditorAddPixelColor" serializeAs="String">
@@ -165,12 +165,12 @@
<setting name="PixelEditorSupportColor" serializeAs="String">
<value>Cyan</value>
</setting>
<setting name="PixelEditorSupportHLColor" serializeAs="String">
<value>DarkCyan</value>
</setting>
<setting name="PixelEditorDrainHoleColor" serializeAs="String">
<value>Plum</value>
</setting>
<setting name="PixelEditorSupportHLColor" serializeAs="String">
<value>DarkCyan</value>
</setting>
<setting name="PixelEditorDrainHoleHLColor" serializeAs="String">
<value>Purple</value>
</setting>
@@ -213,7 +213,8 @@
<setting name="LayerRepairRemoveEmptyLayers" serializeAs="String">
<value>True</value>
</setting>
<setting name="LayerRepairRemoveIslandsBelowEqualPixelsDefault" serializeAs="String">
<setting name="LayerRepairRemoveIslandsBelowEqualPixelsDefault"
serializeAs="String">
<value>10</value>
</setting>
<setting name="PartialUpdateIslandsOnEditing" serializeAs="String">
@@ -222,6 +223,15 @@
<setting name="IslandAllowDiagonalBonds" serializeAs="String">
<value>False</value>
</setting>
<setting name="CrosshairLineLength" serializeAs="String">
<value>20</value>
</setting>
<setting name="CrosshairShowOnSelectedIssuesOnly" serializeAs="String">
<value>True</value>
</setting>
<setting name="CrosshairLineMargin" serializeAs="String">
<value>5</value>
</setting>
</UVtools.GUI.Properties.Settings>
</userSettings>
</configuration>
+156 -47
View File
@@ -123,11 +123,9 @@
this.tbFileSaveNamePreffix = new System.Windows.Forms.TextBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.label37 = new System.Windows.Forms.Label();
this.label36 = new System.Windows.Forms.Label();
this.cbDefaultCrosshairFade = new System.Windows.Forms.ComboBox();
this.cbCrosshairFadeLevel = new System.Windows.Forms.ComboBox();
this.cbAutoZoomIssues = new System.Windows.Forms.CheckBox();
this.cbDefaultAutoZoomLock = new System.Windows.Forms.ComboBox();
this.cbAutoZoomLockLevel = new System.Windows.Forms.ComboBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.cbPartialUpdateIslandsOnEditing = new System.Windows.Forms.CheckBox();
@@ -155,6 +153,15 @@
this.cbLayerRepairLayersIslands = new System.Windows.Forms.CheckBox();
this.panel1 = new System.Windows.Forms.Panel();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.nmCrosshairLineLength = new System.Windows.Forms.NumericUpDown();
this.label38 = new System.Windows.Forms.Label();
this.cbCrosshairShowOnSelectedIssuesOnly = new System.Windows.Forms.CheckBox();
this.label36 = new System.Windows.Forms.Label();
this.label37 = new System.Windows.Forms.Label();
this.label39 = new System.Windows.Forms.Label();
this.label40 = new System.Windows.Forms.Label();
this.label41 = new System.Windows.Forms.Label();
this.nmCrosshairLineMargin = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.nmOutlineHollowAreasLineThickness)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmOutlineLayerBoundsLineThickness)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmOutlinePrintVolumeBoundsLineThickness)).BeginInit();
@@ -182,6 +189,8 @@
((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultOpeningIterations)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultClosingIterations)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmCrosshairLineLength)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmCrosshairLineMargin)).BeginInit();
this.SuspendLayout();
//
// label1
@@ -1319,11 +1328,18 @@
//
// tabPage2
//
this.tabPage2.Controls.Add(this.label40);
this.tabPage2.Controls.Add(this.label41);
this.tabPage2.Controls.Add(this.nmCrosshairLineMargin);
this.tabPage2.Controls.Add(this.label39);
this.tabPage2.Controls.Add(this.label37);
this.tabPage2.Controls.Add(this.label36);
this.tabPage2.Controls.Add(this.cbDefaultCrosshairFade);
this.tabPage2.Controls.Add(this.cbCrosshairShowOnSelectedIssuesOnly);
this.tabPage2.Controls.Add(this.label38);
this.tabPage2.Controls.Add(this.nmCrosshairLineLength);
this.tabPage2.Controls.Add(this.cbCrosshairFadeLevel);
this.tabPage2.Controls.Add(this.cbAutoZoomIssues);
this.tabPage2.Controls.Add(this.cbDefaultAutoZoomLock);
this.tabPage2.Controls.Add(this.cbAutoZoomLockLevel);
this.tabPage2.Controls.Add(this.cbZoomToFitPrintVolumeBounds);
this.tabPage2.Controls.Add(this.label1);
this.tabPage2.Controls.Add(this.label2);
@@ -1365,55 +1381,35 @@
this.tabPage2.Text = "Layer Preview";
this.tabPage2.UseVisualStyleBackColor = true;
//
// label37
// cbCrosshairFadeLevel
//
this.label37.AutoSize = true;
this.label37.Location = new System.Drawing.Point(362, 374);
this.label37.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(152, 18);
this.label37.TabIndex = 39;
this.label37.Text = "Crosshair Fade Level:";
//
// label36
//
this.label36.AutoSize = true;
this.label36.Location = new System.Drawing.Point(9, 374);
this.label36.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label36.Name = "label36";
this.label36.Size = new System.Drawing.Size(165, 18);
this.label36.TabIndex = 38;
this.label36.Text = "Auto zoom default level:";
//
// cbDefaultCrosshairFade
//
this.cbDefaultCrosshairFade.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cbDefaultCrosshairFade.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbDefaultCrosshairFade.FormattingEnabled = true;
this.cbDefaultCrosshairFade.Location = new System.Drawing.Point(521, 370);
this.cbDefaultCrosshairFade.Name = "cbDefaultCrosshairFade";
this.cbDefaultCrosshairFade.Size = new System.Drawing.Size(68, 26);
this.cbDefaultCrosshairFade.TabIndex = 37;
this.cbCrosshairFadeLevel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cbCrosshairFadeLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbCrosshairFadeLevel.FormattingEnabled = true;
this.cbCrosshairFadeLevel.Location = new System.Drawing.Point(448, 359);
this.cbCrosshairFadeLevel.Name = "cbCrosshairFadeLevel";
this.cbCrosshairFadeLevel.Size = new System.Drawing.Size(68, 26);
this.cbCrosshairFadeLevel.TabIndex = 37;
//
// cbAutoZoomIssues
//
this.cbAutoZoomIssues.AutoSize = true;
this.cbAutoZoomIssues.Location = new System.Drawing.Point(11, 305);
this.cbAutoZoomIssues.Name = "cbAutoZoomIssues";
this.cbAutoZoomIssues.Size = new System.Drawing.Size(395, 22);
this.cbAutoZoomIssues.Size = new System.Drawing.Size(429, 22);
this.cbAutoZoomIssues.TabIndex = 35;
this.cbAutoZoomIssues.Text = "Auto zoom to issues and drawings portrait area (best fit)";
this.cbAutoZoomIssues.Text = "Auto zoom to issues and drawings portrait area (best fit) with:";
this.cbAutoZoomIssues.UseVisualStyleBackColor = true;
//
// cbDefaultAutoZoomLock
// cbAutoZoomLockLevel
//
this.cbDefaultAutoZoomLock.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cbDefaultAutoZoomLock.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbDefaultAutoZoomLock.FormattingEnabled = true;
this.cbDefaultAutoZoomLock.Location = new System.Drawing.Point(181, 370);
this.cbDefaultAutoZoomLock.Name = "cbDefaultAutoZoomLock";
this.cbDefaultAutoZoomLock.Size = new System.Drawing.Size(68, 26);
this.cbDefaultAutoZoomLock.TabIndex = 36;
this.cbAutoZoomLockLevel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cbAutoZoomLockLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbAutoZoomLockLevel.FormattingEnabled = true;
this.cbAutoZoomLockLevel.Location = new System.Drawing.Point(443, 303);
this.cbAutoZoomLockLevel.Name = "cbAutoZoomLockLevel";
this.cbAutoZoomLockLevel.Size = new System.Drawing.Size(68, 26);
this.cbAutoZoomLockLevel.TabIndex = 36;
//
// tabPage3
//
@@ -1760,6 +1756,110 @@
this.toolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
this.toolTip.ToolTipTitle = "Information";
//
// nmCrosshairLineLength
//
this.nmCrosshairLineLength.Location = new System.Drawing.Point(162, 389);
this.nmCrosshairLineLength.Maximum = new decimal(new int[] {
1000000,
0,
0,
0});
this.nmCrosshairLineLength.Name = "nmCrosshairLineLength";
this.nmCrosshairLineLength.Size = new System.Drawing.Size(57, 24);
this.nmCrosshairLineLength.TabIndex = 40;
//
// label38
//
this.label38.AutoSize = true;
this.label38.Location = new System.Drawing.Point(518, 307);
this.label38.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label38.Name = "label38";
this.label38.Size = new System.Drawing.Size(47, 18);
this.label38.TabIndex = 41;
this.label38.Text = "zoom";
//
// cbCrosshairShowOnSelectedIssuesOnly
//
this.cbCrosshairShowOnSelectedIssuesOnly.AutoSize = true;
this.cbCrosshairShowOnSelectedIssuesOnly.Location = new System.Drawing.Point(11, 361);
this.cbCrosshairShowOnSelectedIssuesOnly.Name = "cbCrosshairShowOnSelectedIssuesOnly";
this.cbCrosshairShowOnSelectedIssuesOnly.Size = new System.Drawing.Size(431, 22);
this.cbCrosshairShowOnSelectedIssuesOnly.TabIndex = 42;
this.cbCrosshairShowOnSelectedIssuesOnly.Text = "Show crossharis only for selected issues and hide them after:";
this.cbCrosshairShowOnSelectedIssuesOnly.UseVisualStyleBackColor = true;
//
// label36
//
this.label36.AutoSize = true;
this.label36.Location = new System.Drawing.Point(9, 392);
this.label36.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label36.Name = "label36";
this.label36.Size = new System.Drawing.Size(146, 18);
this.label36.TabIndex = 43;
this.label36.Text = "Crosshair line length:";
//
// label37
//
this.label37.AutoSize = true;
this.label37.Location = new System.Drawing.Point(523, 363);
this.label37.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(47, 18);
this.label37.TabIndex = 44;
this.label37.Text = "zoom";
//
// label39
//
this.label39.AutoSize = true;
this.label39.Location = new System.Drawing.Point(226, 392);
this.label39.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(213, 18);
this.label39.TabIndex = 45;
this.label39.Text = "px (0 to fill up to image bounds)";
//
// label40
//
this.label40.AutoSize = true;
this.label40.Location = new System.Drawing.Point(226, 422);
this.label40.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label40.Name = "label40";
this.label40.Size = new System.Drawing.Size(23, 18);
this.label40.TabIndex = 48;
this.label40.Text = "px";
//
// label41
//
this.label41.AutoSize = true;
this.label41.Location = new System.Drawing.Point(9, 422);
this.label41.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label41.Name = "label41";
this.label41.Size = new System.Drawing.Size(126, 18);
this.label41.TabIndex = 47;
this.label41.Text = "Crosshair margin:";
//
// nmCrosshairLineMargin
//
this.nmCrosshairLineMargin.Location = new System.Drawing.Point(162, 419);
this.nmCrosshairLineMargin.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.nmCrosshairLineMargin.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.nmCrosshairLineMargin.Name = "nmCrosshairLineMargin";
this.nmCrosshairLineMargin.Size = new System.Drawing.Size(57, 24);
this.nmCrosshairLineMargin.TabIndex = 46;
this.nmCrosshairLineMargin.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// FrmSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -1812,6 +1912,8 @@
((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultOpeningIterations)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultClosingIterations)).EndInit();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.nmCrosshairLineLength)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmCrosshairLineMargin)).EndInit();
this.ResumeLayout(false);
}
@@ -1926,7 +2028,7 @@
private System.Windows.Forms.Label label32;
private System.Windows.Forms.TextBox tbFileExtractDefaultDirectory;
private System.Windows.Forms.CheckBox cbAutoZoomIssues;
private System.Windows.Forms.ComboBox cbDefaultAutoZoomLock;
private System.Windows.Forms.ComboBox cbAutoZoomLockLevel;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.CheckBox cbLayerRepairLayersIslands;
private System.Windows.Forms.CheckBox cbLayerRepairRemoveEmptyLayers;
@@ -1940,8 +2042,15 @@
private System.Windows.Forms.CheckBox cbPartialUpdateIslandsOnEditing;
private System.Windows.Forms.CheckBox cbIslandAllowDiagonalBonds;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.ComboBox cbDefaultCrosshairFade;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.ComboBox cbCrosshairFadeLevel;
private System.Windows.Forms.NumericUpDown nmCrosshairLineLength;
private System.Windows.Forms.Label label38;
private System.Windows.Forms.Label label36;
private System.Windows.Forms.CheckBox cbCrosshairShowOnSelectedIssuesOnly;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.Label label40;
private System.Windows.Forms.Label label41;
private System.Windows.Forms.NumericUpDown nmCrosshairLineMargin;
}
}
+12 -6
View File
@@ -26,8 +26,8 @@ namespace UVtools.GUI.Forms
// ZoomLevels constant array, and add those strings to the comboboxes.
var zoomRange = FrmMain.ZoomLevels.Skip(FrmMain.ZoomLevelSkipCount).Select(
s => Convert.ToString((double)s / 100) + "x").ToArray();
cbDefaultAutoZoomLock.Items.AddRange(zoomRange);
cbDefaultCrosshairFade.Items.AddRange(zoomRange);
cbAutoZoomLockLevel.Items.AddRange(zoomRange);
cbCrosshairFadeLevel.Items.AddRange(zoomRange);
Init();
}
@@ -55,8 +55,11 @@ namespace UVtools.GUI.Forms
btnResinTrapColor.BackColor = Settings.Default.ResinTrapColor;
btnResinTrapHLColor.BackColor = Settings.Default.ResinTrapHLColor;
btnTouchingBoundsColor.BackColor = Settings.Default.TouchingBoundsColor;
cbDefaultAutoZoomLock.SelectedIndex = Settings.Default.DefaultAutoZoomLock;
cbDefaultCrosshairFade.SelectedIndex = Settings.Default.DefaultCrosshairFade;
cbAutoZoomLockLevel.SelectedIndex = Settings.Default.AutoZoomLockLevel;
cbCrosshairShowOnSelectedIssuesOnly.Checked = Settings.Default.CrosshairShowOnSelectedIssuesOnly;
cbCrosshairFadeLevel.SelectedIndex = Settings.Default.CrosshairFadeLevel;
nmCrosshairLineLength.Value = Settings.Default.CrosshairLineLength;
nmCrosshairLineMargin.Value = Settings.Default.CrosshairLineMargin;
btnOutlinePrintVolumeBoundsColor.BackColor = Settings.Default.OutlinePrintVolumeBoundsColor;
btnOutlineLayerBoundsColor.BackColor = Settings.Default.OutlineLayerBoundsColor;
@@ -221,8 +224,11 @@ namespace UVtools.GUI.Forms
Settings.Default.ResinTrapColor = btnResinTrapColor.BackColor;
Settings.Default.ResinTrapHLColor = btnResinTrapHLColor.BackColor;
Settings.Default.TouchingBoundsColor = btnTouchingBoundsColor.BackColor;
Settings.Default.DefaultCrosshairFade = (byte)cbDefaultCrosshairFade.SelectedIndex;
Settings.Default.DefaultAutoZoomLock = (byte)cbDefaultAutoZoomLock.SelectedIndex;
Settings.Default.CrosshairFadeLevel = (byte)cbCrosshairFadeLevel.SelectedIndex;
Settings.Default.AutoZoomLockLevel = (byte)cbAutoZoomLockLevel.SelectedIndex;
Settings.Default.CrosshairShowOnSelectedIssuesOnly = cbCrosshairShowOnSelectedIssuesOnly.Checked;
Settings.Default.CrosshairLineLength = (uint) nmCrosshairLineLength.Value;
Settings.Default.CrosshairLineMargin = (byte) nmCrosshairLineMargin.Value;
Settings.Default.OutlinePrintVolumeBoundsColor = btnOutlinePrintVolumeBoundsColor.BackColor;
Settings.Default.OutlineLayerBoundsColor = btnOutlineLayerBoundsColor.BackColor;
+4 -3
View File
@@ -981,8 +981,8 @@
this.tsLayerImageZoom.Name = "tsLayerImageZoom";
this.tsLayerImageZoom.Size = new System.Drawing.Size(81, 22);
this.tsLayerImageZoom.Text = "Zoom: [1x]";
this.tsLayerImageZoom.ToolTipText = "Layer image zoom level, use mouse scroll to zoom in/out into image\r\nCtrl + 0 to s" +
"cale to fit";
this.tsLayerImageZoom.ToolTipText = "Layer image zoom level, use mouse scroll to zoom in/out into image\r\nCtrl + 0 OR d" +
"ouble right click to scale to fit";
//
// toolStripSeparator8
//
@@ -1014,7 +1014,8 @@
this.tsLayerImageMouseLocation.Name = "tsLayerImageMouseLocation";
this.tsLayerImageMouseLocation.Size = new System.Drawing.Size(79, 22);
this.tsLayerImageMouseLocation.Text = "{X=0, Y=0}";
this.tsLayerImageMouseLocation.ToolTipText = "Mouse over pixel location and pixel brightness";
this.tsLayerImageMouseLocation.ToolTipText = "Mouse over pixel location and pixel brightness\r\nUse SHIFT while move mouse hover " +
"pixels";
//
// tsLayerImagePixelCount
//
+44 -13
View File
@@ -179,7 +179,7 @@ namespace UVtools.GUI
/// <summary>
/// Returns the zoom level at which the crosshairs will fade and no longer be displayed
/// </summary>
public int CrosshairFadeLevel => ZoomLevels[Settings.Default.DefaultCrosshairFade + ZoomLevelSkipCount];
public int CrosshairFadeLevel => ZoomLevels[Settings.Default.CrosshairFadeLevel + ZoomLevelSkipCount];
/// <summary>
/// Returns the zoom level that will be used for autozoom actions
@@ -224,7 +224,7 @@ namespace UVtools.GUI
pbLayer.ZoomLevels = new Cyotek.Windows.Forms.ZoomLevelCollection(ZoomLevels);
// Initialize the zoom level used for autozoom based on the stored default settings.
AutoZoomBackIndex =
ConvZoomToBackIndex(ZoomLevels[Settings.Default.DefaultAutoZoomLock + ZoomLevelSkipCount]);
ConvZoomToBackIndex(ZoomLevels[Settings.Default.AutoZoomLockLevel + ZoomLevelSkipCount]);
if (Settings.Default.StartMaximized || Width >= Screen.FromControl(this).WorkingArea.Width ||
Height >= Screen.FromControl(this).WorkingArea.Height)
@@ -2844,28 +2844,59 @@ namespace UVtools.GUI
|| issue.Type == LayerIssue.IssueType.TouchingBound) continue;
var color = new MCvScalar(Color.Red.B, Color.Red.G, Color.Red.R);
CvInvoke.Line(ActualLayerImageBgr,
new Point(0, issue.BoundingRectangle.Y + issue.BoundingRectangle.Height / 2),
new Point(issue.BoundingRectangle.Left - 10, issue.BoundingRectangle.Y + issue.BoundingRectangle.Height / 2),
color,
lineThickness);
// LEFT
Point startPoint = new Point(Math.Max(0, issue.BoundingRectangle.X - Settings.Default.CrosshairLineMargin - 1), issue.BoundingRectangle.Y + issue.BoundingRectangle.Height / 2);
Point endPoint =
new Point(
Settings.Default.CrosshairLineLength == 0
? 0
: (int) Math.Max(0, startPoint.X - Settings.Default.CrosshairLineLength + 1),
startPoint.Y);
CvInvoke.Line(ActualLayerImageBgr,
new Point(issue.BoundingRectangle.Right + 10, issue.BoundingRectangle.Y + issue.BoundingRectangle.Height / 2),
new Point(ActualLayerImageBgr.Width, issue.BoundingRectangle.Y + issue.BoundingRectangle.Height / 2),
startPoint,
endPoint,
color,
lineThickness);
// RIGHT
startPoint.X = Math.Min(ActualLayerImageBgr.Width,
issue.BoundingRectangle.Right + Settings.Default.CrosshairLineMargin);
endPoint.X = Settings.Default.CrosshairLineLength == 0
? ActualLayerImageBgr.Width
: (int)Math.Min(ActualLayerImageBgr.Width, startPoint.X + Settings.Default.CrosshairLineLength - 1);
CvInvoke.Line(ActualLayerImageBgr,
new Point(issue.BoundingRectangle.X + issue.BoundingRectangle.Width / 2, 0),
new Point(issue.BoundingRectangle.X + issue.BoundingRectangle.Width / 2, issue.BoundingRectangle.Top - 10),
startPoint,
endPoint,
color,
lineThickness);
// TOP
startPoint = new Point(issue.BoundingRectangle.X + issue.BoundingRectangle.Width / 2,
Math.Max(0, issue.BoundingRectangle.Y - Settings.Default.CrosshairLineMargin - 1));
endPoint = new Point(startPoint.X,
(int) (Settings.Default.CrosshairLineLength == 0
? 0
: Math.Max(0, startPoint.Y - Settings.Default.CrosshairLineLength + 1)));
CvInvoke.Line(ActualLayerImageBgr,
new Point(issue.BoundingRectangle.X + issue.BoundingRectangle.Width / 2, issue.BoundingRectangle.Bottom + 10),
new Point(issue.BoundingRectangle.X + issue.BoundingRectangle.Width / 2, ActualLayerImageBgr.Height),
startPoint,
endPoint,
color,
lineThickness);
// Bottom
startPoint.Y = Math.Min(ActualLayerImageBgr.Height, issue.BoundingRectangle.Bottom + Settings.Default.CrosshairLineMargin);
endPoint.Y = Settings.Default.CrosshairLineLength == 0 ? ActualLayerImageBgr.Height : (int) Math.Min(ActualLayerImageBgr.Height, startPoint.Y + Settings.Default.CrosshairLineLength - 1);
CvInvoke.Line(ActualLayerImageBgr,
startPoint,
endPoint,
color,
lineThickness);
}
+26 -8
View File
@@ -129,12 +129,6 @@
<metadata name="tsLayerInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1773, 17</value>
</metadata>
<metadata name="tsThumbnails.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>297, 17</value>
</metadata>
<metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>695, 17</value>
</metadata>
<metadata name="tsGCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1040, 17</value>
</metadata>
@@ -158,7 +152,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk
FAAAAk1TRnQBSQFMAgEBBgEAAUgBCQFIAQkBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
FAAAAk1TRnQBSQFMAgEBBgEAAVABCQFQAQkBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIC4AAxgBIgMwAUsDMAFMAzIBUDMAAQEDJAE2AysBQqwAAyIBMQNWAbkDXQHi
AwAB/wMAAf8BKgEtASgB/gNTAawDTQGVAwABARgAAwkBDAMzAVIDUAGdA1cB6AMAAf4DKwH8Ay8BSqQA
AyEBMANZAewBKwEuASkB+gNRAfcDUgH0A1MB8QNIAfYDQQH5AwAB/wNPAZsDAAEBCAADFQEdAz8BbgNV
@@ -206,7 +200,7 @@
BAADUgGpAzQBVQM0AVUgAAM0AVUDNAFVA1IBqQgAA0oBiwMAAf8DAAH/A08BnAQAA00BlQMAAf8DVAGr
CAADTwGcAwAB/wMAAf8DSgGLBAADUQGgAQABzAH3Af8BAAHMAfcB/wEAAcwB9wH/AQABzAH3Af8DQwF3
CAADSgGNAgAB7AH/AgAB7AH/AgAB7wH/AgAB7AH/AgAB7AH/AgAB7QH/AVICUwGoA1IBqAMAAf8DAAH/
AwAB/wNRAfcDMAH9A1ABnwsAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wNSAagEAANSAakDNAFVAzQBVQNG
AwAB/wNRAfcDMQH9A1ABnwsAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wNSAagEAANSAakDNAFVAzQBVQNG
AYADUgGpA1IBqQNSAakDUgGpA1IBqQNSAakDRQF/AzQBVQM0AVUDUgGpBAADUQGiAwAB/wMAAf8DSQGJ
CAADLwFKAwAB/wNUAe4MAANJAYkDAAH/AwAB/wNRAaIDAAEBAT8CQAFvAT4CXAH4AQABzQH3Af8BAAHN
AfcB/wMSARgIAAMBAQIDRgF+AlIBXQHwAgAB7gH/AgAB7gH/AkABqAH9AUUCRgF+AwMBBANSAagDAAH/
@@ -248,6 +242,27 @@
AfwBPws=
</value>
</data>
<metadata name="tsThumbnails.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>297, 17</value>
</metadata>
<metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>695, 17</value>
</metadata>
<metadata name="tsGCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1040, 17</value>
</metadata>
<metadata name="tsIssuesLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1668, 17</value>
</metadata>
<metadata name="tsIssues.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>947, 17</value>
</metadata>
<metadata name="tsPixelEditorHistory.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1430, 17</value>
</metadata>
<metadata name="tsLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1587, 17</value>
</metadata>
<metadata name="toolTipInformation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1138, 17</value>
</metadata>
@@ -257,6 +272,9 @@
<metadata name="issueScrollTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>158, 17</value>
</metadata>
<metadata name="toolTipInformation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1138, 17</value>
</metadata>
<metadata name="layerScrollTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1292, 17</value>
</metadata>
+43 -7
View File
@@ -12,7 +12,7 @@ namespace UVtools.GUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -482,24 +482,24 @@ namespace UVtools.GUI.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("5")]
public byte DefaultCrosshairFade {
public byte CrosshairFadeLevel {
get {
return ((byte)(this["DefaultCrosshairFade"]));
return ((byte)(this["CrosshairFadeLevel"]));
}
set {
this["DefaultCrosshairFade"] = value;
this["CrosshairFadeLevel"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("7")]
public byte DefaultAutoZoomLock {
public byte AutoZoomLockLevel {
get {
return ((byte)(this["DefaultAutoZoomLock"]));
return ((byte)(this["AutoZoomLockLevel"]));
}
set {
this["DefaultAutoZoomLock"] = value;
this["AutoZoomLockLevel"] = value;
}
}
@@ -790,5 +790,41 @@ namespace UVtools.GUI.Properties {
this["IslandAllowDiagonalBonds"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("20")]
public uint CrosshairLineLength {
get {
return ((uint)(this["CrosshairLineLength"]));
}
set {
this["CrosshairLineLength"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool CrosshairShowOnSelectedIssuesOnly {
get {
return ((bool)(this["CrosshairShowOnSelectedIssuesOnly"]));
}
set {
this["CrosshairShowOnSelectedIssuesOnly"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("5")]
public byte CrosshairLineMargin {
get {
return ((byte)(this["CrosshairLineMargin"]));
}
set {
this["CrosshairLineMargin"] = value;
}
}
}
}
+11 -2
View File
@@ -116,10 +116,10 @@
<Setting Name="DefaultOpenFileExtension" Type="System.Byte" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="DefaultCrosshairFade" Type="System.Byte" Scope="User">
<Setting Name="CrosshairFadeLevel" Type="System.Byte" Scope="User">
<Value Profile="(Default)">5</Value>
</Setting>
<Setting Name="DefaultAutoZoomLock" Type="System.Byte" Scope="User">
<Setting Name="AutoZoomLockLevel" Type="System.Byte" Scope="User">
<Value Profile="(Default)">7</Value>
</Setting>
<Setting Name="PixelEditorAddPixelColor" Type="System.Drawing.Color" Scope="User">
@@ -194,5 +194,14 @@
<Setting Name="IslandAllowDiagonalBonds" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="CrosshairLineLength" Type="System.UInt32" Scope="User">
<Value Profile="(Default)">20</Value>
</Setting>
<Setting Name="CrosshairShowOnSelectedIssuesOnly" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="CrosshairLineMargin" Type="System.Byte" Scope="User">
<Value Profile="(Default)">5</Value>
</Setting>
</Settings>
</SettingsFile>