diff --git a/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs b/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs new file mode 100644 index 00000000..82857ab4 --- /dev/null +++ b/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PckStudio.Extensions; + +namespace PckStudio.ToolboxItems +{ + internal class BlendPictureBox : PictureBoxWithInterpolationMode + { + [DefaultValue(false)] + [Category("Blending")] + public bool UseBlendColor + { + get => _useBlendColor; + set => _useBlendColor = value; + } + + [DefaultValue(typeof(Color), "Color.White")] + [Category("Blending")] + public Color BlendColor + { + get => _blendColor; + set + { + UseBlendColor = value != Color.White; + _blendColor = value; + } + } + + [DefaultValue(typeof(BlendMode), "BlendMode.Add")] + [Category("Blending")] + public BlendMode BlendMode + { + get => _blendMode; + set => _blendMode = value; + } + + private bool _useBlendColor = false; + private Color _blendColor = Color.White; + private BlendMode _blendMode = BlendMode.Add; + + public new Image Image + { + get => base.Image; + set => base.Image = UseBlendColor ? value.Blend(BlendColor, BlendMode) : value; + } + } +} diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 6d5ceed9..192dbc68 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -132,6 +132,9 @@ + + Component + Component @@ -768,57 +771,49 @@ --> - - - - - - - - - - - - $(GitHash) - $(GitBranch) - - - - - - $(IntermediateOutputPath)GitAssemblyInfo.cs - - - - - - - - - <_Parameter1>GitHash - <_Parameter2>$(BuildHash) - - - <_Parameter1>GitBranch - <_Parameter2>$(BuildBranch) - - - - - - - - - - - - - $([System.DateTime]::Now.ToString('yyyy-MM-dd')) - - - - + + + + + + + + + + $(GitHash) + $(GitBranch) + + + + + + $(IntermediateOutputPath)GitAssemblyInfo.cs + + + + + + + + + <_Parameter1>GitHash + <_Parameter2>$(BuildHash) + + + <_Parameter1>GitBranch + <_Parameter2>$(BuildBranch) + + + + + + + + + + + $([System.DateTime]::Now.ToString('yyyy-MM-dd')) + + + \ No newline at end of file