Change shadow angle

This commit is contained in:
Jaex 2023-06-13 07:27:15 +03:00
parent c7925eecaa
commit bf75db0e74
4 changed files with 3 additions and 7 deletions

View file

@ -359,8 +359,7 @@ private void InitializeComponent()
// tbShadowAngle
//
this.tbShadowAngle.Location = new System.Drawing.Point(16, 272);
this.tbShadowAngle.Maximum = 180;
this.tbShadowAngle.Minimum = -180;
this.tbShadowAngle.Maximum = 360;
this.tbShadowAngle.Name = "tbShadowAngle";
this.tbShadowAngle.Size = new System.Drawing.Size(280, 45);
this.tbShadowAngle.TabIndex = 5;

View file

@ -120,9 +120,6 @@
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>58</value>
</metadata>

View file

@ -109,7 +109,7 @@ public Bitmap Render()
if (Options.ShadowOpacity > 0 && (Options.ShadowRadius > 0 || Options.ShadowDistance > 0))
{
float shadowOpacity = Options.ShadowOpacity / 100f;
Point shadowOffset = (Point)MathHelpers.DegreeToVector2(Options.ShadowAngle, Options.ShadowDistance);
Point shadowOffset = (Point)MathHelpers.DegreeToVector2(Options.ShadowAngle - 90, Options.ShadowDistance);
resultImage = ImageHelpers.AddShadow(resultImage, shadowOpacity, Options.ShadowRadius, 0f, Options.ShadowColor, shadowOffset, false);
}

View file

@ -59,7 +59,7 @@ public void ResetOptions()
ShadowRadius = 30;
ShadowOpacity = 80;
ShadowDistance = 10;
ShadowAngle = 90;
ShadowAngle = 180;
ShadowColor = Color.Black;
BackgroundType = ImageBeautifierBackgroundType.Gradient;
BackgroundGradient = new GradientInfo(LinearGradientMode.ForwardDiagonal, Color.FromArgb(255, 81, 47), Color.FromArgb(221, 36, 118));