Files
UVtools/UVtools.GUI/Controls/Tools/CtrlToolMorph.cs
T
Tiago Conceição 5cfd62d36e v0.8.1.0
* (Add) Tools can now run inside a ROI (#49)
* (Add) Layer preview: Hold-Shift + Left-drag to select an ROI (Region of interest) on image, that region will be used instead of whole image when running some tools
* (Add) Layer preview: Hold-Shift + Hold-Alt + Left-drag to select and auto adjust the ROI to the contained objects, that region will be used instead of whole image when running some tools
* (Add) Layer preview: Hold-Shift + Right-click on a object to select its bounding area, that region will be used instead of whole image when running some tools
* (Add) Layer preview: ESC key to clear ROI
* (Add) Layer preview: Overlay text with hints for current action
* (Add) Tool - Move: Now possible to do a copy move instead of a cut move
* (Add) Arrow wait cursor to progress loadings
* (Change) Layer preview: Hold-Shift key to select issues and pick pixel position/brightness changed to Hold-Control key
* (Change) Layer preview: Shift+click combination to zoom-in changed to Alt+click
* (Fix) CTB v3: Bad file when re-encoding
2020-09-12 04:05:32 +01:00

68 lines
2.0 KiB
C#

/*
* 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.Windows.Forms;
using Emgu.CV.CvEnum;
using UVtools.Core.Objects;
using UVtools.Core.Operations;
namespace UVtools.GUI.Controls.Tools
{
public partial class CtrlToolMorph : CtrlToolWindowContent
{
public OperationMorph Operation { get; }
public CtrlToolMorph()
{
InitializeComponent();
Operation = new OperationMorph();
SetOperation(Operation);
cbMorphOperation.Items.AddRange(OperationMorph.MorphOperations);
cbMorphOperation.SelectedIndex = 0;
}
public override bool UpdateOperation()
{
base.UpdateOperation();
Operation.IterationsStart = (uint) nmIterationsStart.Value;
Operation.IterationsEnd = (uint) nmIterationsEnd.Value;
Operation.FadeInOut = cbIterationsFade.Checked;
Operation.MorphOperation = (MorphOp)((StringTag) cbMorphOperation.SelectedItem).Tag;
Operation.Kernel.Anchor = ctrlKernel.KernelAnchor;
Operation.Kernel.Matrix = ctrlKernel.GetMatrix();
return true;
}
public override void ExtraActionCall(object sender)
{
if (ReferenceEquals(sender, ParentToolWindow.cbActionExtra))
{
ctrlKernel.Visible = ParentToolWindow.cbActionExtra.Checked;
return;
}
}
private void EventCheckedChanged(object sender, EventArgs e)
{
if (ReferenceEquals(sender, cbIterationsFade))
{
lbIterationsStop.Enabled =
nmIterationsEnd.Enabled =
cbIterationsFade.Checked;
return;
}
}
}
}