mirror of https://github.com/ShareX/ShareX.git
Rename ShadowSize to ShadowRadius
This commit is contained in:
parent
fc2f5e7ca0
commit
ce4932cdb6
|
@ -36,13 +36,13 @@
|
|||
this.cbSmartPadding = new System.Windows.Forms.CheckBox();
|
||||
this.lblRoundedCorner = new System.Windows.Forms.Label();
|
||||
this.tbRoundedCorner = new System.Windows.Forms.TrackBar();
|
||||
this.lblShadowSize = new System.Windows.Forms.Label();
|
||||
this.tbShadowSize = new System.Windows.Forms.TrackBar();
|
||||
this.lblShadowRadius = new System.Windows.Forms.Label();
|
||||
this.tbShadowRadius = new System.Windows.Forms.TrackBar();
|
||||
this.lblBackground = new System.Windows.Forms.Label();
|
||||
this.lblMarginValue = new System.Windows.Forms.Label();
|
||||
this.lblPaddingValue = new System.Windows.Forms.Label();
|
||||
this.lblRoundedCornerValue = new System.Windows.Forms.Label();
|
||||
this.lblShadowSizeValue = new System.Windows.Forms.Label();
|
||||
this.lblShadowRadiusValue = new System.Windows.Forms.Label();
|
||||
this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.pbPreview = new ShareX.HelpersLib.MyPictureBox();
|
||||
this.pOptions = new System.Windows.Forms.Panel();
|
||||
|
@ -72,7 +72,7 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.tbMargin)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbPadding)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbRoundedCorner)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbShadowSize)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbShadowRadius)).BeginInit();
|
||||
this.tlpMain.SuspendLayout();
|
||||
this.pOptions.SuspendLayout();
|
||||
this.gbShadow.SuspendLayout();
|
||||
|
@ -160,27 +160,27 @@
|
|||
this.tbRoundedCorner.Scroll += new System.EventHandler(this.tbRoundedCorner_Scroll);
|
||||
this.tbRoundedCorner.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbRoundedCorner_MouseUp);
|
||||
//
|
||||
// lblShadowSize
|
||||
// lblShadowRadius
|
||||
//
|
||||
this.lblShadowSize.AutoSize = true;
|
||||
this.lblShadowSize.Location = new System.Drawing.Point(16, 32);
|
||||
this.lblShadowSize.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblShadowSize.Name = "lblShadowSize";
|
||||
this.lblShadowSize.Size = new System.Drawing.Size(34, 17);
|
||||
this.lblShadowSize.TabIndex = 10;
|
||||
this.lblShadowSize.Text = "Size:";
|
||||
this.lblShadowRadius.AutoSize = true;
|
||||
this.lblShadowRadius.Location = new System.Drawing.Point(16, 32);
|
||||
this.lblShadowRadius.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblShadowRadius.Name = "lblShadowRadius";
|
||||
this.lblShadowRadius.Size = new System.Drawing.Size(50, 17);
|
||||
this.lblShadowRadius.TabIndex = 10;
|
||||
this.lblShadowRadius.Text = "Radius:";
|
||||
//
|
||||
// tbShadowSize
|
||||
// tbShadowRadius
|
||||
//
|
||||
this.tbShadowSize.AutoSize = false;
|
||||
this.tbShadowSize.Location = new System.Drawing.Point(16, 56);
|
||||
this.tbShadowSize.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.tbShadowSize.Maximum = 100;
|
||||
this.tbShadowSize.Name = "tbShadowSize";
|
||||
this.tbShadowSize.Size = new System.Drawing.Size(280, 32);
|
||||
this.tbShadowSize.TabIndex = 11;
|
||||
this.tbShadowSize.TickFrequency = 5;
|
||||
this.tbShadowSize.Scroll += new System.EventHandler(this.tbShadowSize_Scroll);
|
||||
this.tbShadowRadius.AutoSize = false;
|
||||
this.tbShadowRadius.Location = new System.Drawing.Point(16, 56);
|
||||
this.tbShadowRadius.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.tbShadowRadius.Maximum = 100;
|
||||
this.tbShadowRadius.Name = "tbShadowRadius";
|
||||
this.tbShadowRadius.Size = new System.Drawing.Size(280, 32);
|
||||
this.tbShadowRadius.TabIndex = 11;
|
||||
this.tbShadowRadius.TickFrequency = 5;
|
||||
this.tbShadowRadius.Scroll += new System.EventHandler(this.tbShadowRadius_Scroll);
|
||||
//
|
||||
// lblBackground
|
||||
//
|
||||
|
@ -222,15 +222,15 @@
|
|||
this.lblRoundedCornerValue.Text = "0";
|
||||
this.lblRoundedCornerValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// lblShadowSizeValue
|
||||
// lblShadowRadiusValue
|
||||
//
|
||||
this.lblShadowSizeValue.Location = new System.Drawing.Point(256, 32);
|
||||
this.lblShadowSizeValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblShadowSizeValue.Name = "lblShadowSizeValue";
|
||||
this.lblShadowSizeValue.Size = new System.Drawing.Size(40, 24);
|
||||
this.lblShadowSizeValue.TabIndex = 12;
|
||||
this.lblShadowSizeValue.Text = "0";
|
||||
this.lblShadowSizeValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.lblShadowRadiusValue.Location = new System.Drawing.Point(256, 32);
|
||||
this.lblShadowRadiusValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblShadowRadiusValue.Name = "lblShadowRadiusValue";
|
||||
this.lblShadowRadiusValue.Size = new System.Drawing.Size(40, 24);
|
||||
this.lblShadowRadiusValue.TabIndex = 12;
|
||||
this.lblShadowRadiusValue.Text = "0";
|
||||
this.lblShadowRadiusValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// tlpMain
|
||||
//
|
||||
|
@ -299,11 +299,11 @@
|
|||
this.gbShadow.Controls.Add(this.lblShadowDistanceValue);
|
||||
this.gbShadow.Controls.Add(this.lblShadowOpacityValue);
|
||||
this.gbShadow.Controls.Add(this.btnShadowColor);
|
||||
this.gbShadow.Controls.Add(this.tbShadowSize);
|
||||
this.gbShadow.Controls.Add(this.tbShadowRadius);
|
||||
this.gbShadow.Controls.Add(this.tbShadowAngle);
|
||||
this.gbShadow.Controls.Add(this.lblShadowSizeValue);
|
||||
this.gbShadow.Controls.Add(this.lblShadowRadiusValue);
|
||||
this.gbShadow.Controls.Add(this.lblShadowAngle);
|
||||
this.gbShadow.Controls.Add(this.lblShadowSize);
|
||||
this.gbShadow.Controls.Add(this.lblShadowRadius);
|
||||
this.gbShadow.Controls.Add(this.tbShadowDistance);
|
||||
this.gbShadow.Controls.Add(this.lblShadowOpacity);
|
||||
this.gbShadow.Controls.Add(this.lblShadowDistance);
|
||||
|
@ -553,7 +553,7 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.tbMargin)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbPadding)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbRoundedCorner)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbShadowSize)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbShadowRadius)).EndInit();
|
||||
this.tlpMain.ResumeLayout(false);
|
||||
this.pOptions.ResumeLayout(false);
|
||||
this.pOptions.PerformLayout();
|
||||
|
@ -575,13 +575,13 @@
|
|||
private System.Windows.Forms.CheckBox cbSmartPadding;
|
||||
private System.Windows.Forms.Label lblRoundedCorner;
|
||||
private System.Windows.Forms.TrackBar tbRoundedCorner;
|
||||
private System.Windows.Forms.Label lblShadowSize;
|
||||
private System.Windows.Forms.TrackBar tbShadowSize;
|
||||
private System.Windows.Forms.Label lblShadowRadius;
|
||||
private System.Windows.Forms.TrackBar tbShadowRadius;
|
||||
private System.Windows.Forms.Label lblBackground;
|
||||
private System.Windows.Forms.Label lblMarginValue;
|
||||
private System.Windows.Forms.Label lblPaddingValue;
|
||||
private System.Windows.Forms.Label lblRoundedCornerValue;
|
||||
private System.Windows.Forms.Label lblShadowSizeValue;
|
||||
private System.Windows.Forms.Label lblShadowRadiusValue;
|
||||
private System.Windows.Forms.TableLayoutPanel tlpMain;
|
||||
private System.Windows.Forms.Panel pOptions;
|
||||
private HelpersLib.MyPictureBox pbPreview;
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace ShareX.MediaLib
|
|||
tbPadding.SetValue(Options.Padding);
|
||||
cbSmartPadding.Checked = Options.SmartPadding;
|
||||
tbRoundedCorner.SetValue(Options.RoundedCorner);
|
||||
tbShadowSize.SetValue(Options.ShadowSize);
|
||||
tbShadowRadius.SetValue(Options.ShadowRadius);
|
||||
tbShadowOpacity.SetValue(Options.ShadowOpacity);
|
||||
tbShadowDistance.SetValue(Options.ShadowDistance);
|
||||
tbShadowAngle.SetValue(Options.ShadowAngle);
|
||||
|
@ -100,13 +100,13 @@ namespace ShareX.MediaLib
|
|||
|
||||
private void UpdateUI()
|
||||
{
|
||||
lblMarginValue.Text = tbMargin.Value.ToString();
|
||||
lblPaddingValue.Text = tbPadding.Value.ToString();
|
||||
lblMarginValue.Text = tbMargin.Value.ToString() + " px";
|
||||
lblPaddingValue.Text = tbPadding.Value.ToString() + " px";
|
||||
lblRoundedCornerValue.Text = tbRoundedCorner.Value.ToString();
|
||||
lblShadowSizeValue.Text = tbShadowSize.Value.ToString();
|
||||
lblShadowOpacityValue.Text = tbShadowOpacity.Value.ToString();
|
||||
lblShadowDistanceValue.Text = tbShadowDistance.Value.ToString();
|
||||
lblShadowAngleValue.Text = tbShadowAngle.Value.ToString();
|
||||
lblShadowRadiusValue.Text = tbShadowRadius.Value.ToString();
|
||||
lblShadowOpacityValue.Text = tbShadowOpacity.Value.ToString() + "%";
|
||||
lblShadowDistanceValue.Text = tbShadowDistance.Value.ToString() + " px";
|
||||
lblShadowAngleValue.Text = tbShadowAngle.Value.ToString() + "°";
|
||||
lblBackgroundImageFilePath.Text = Options.BackgroundImageFilePath;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ namespace ShareX.MediaLib
|
|||
|
||||
if (quickRender)
|
||||
{
|
||||
options.ShadowSize = 0;
|
||||
options.ShadowRadius = 0;
|
||||
}
|
||||
|
||||
Stopwatch renderTime = Stopwatch.StartNew();
|
||||
|
@ -205,7 +205,7 @@ namespace ShareX.MediaLib
|
|||
Options.Padding = tbPadding.Value;
|
||||
Options.SmartPadding = cbSmartPadding.Checked;
|
||||
Options.RoundedCorner = tbRoundedCorner.Value;
|
||||
Options.ShadowSize = tbShadowSize.Value;
|
||||
Options.ShadowRadius = tbShadowRadius.Value;
|
||||
Options.ShadowOpacity = tbShadowOpacity.Value;
|
||||
Options.ShadowDistance = tbShadowDistance.Value;
|
||||
Options.ShadowAngle = tbShadowAngle.Value;
|
||||
|
@ -278,7 +278,7 @@ namespace ShareX.MediaLib
|
|||
}
|
||||
}
|
||||
|
||||
private async void tbShadowSize_Scroll(object sender, EventArgs e)
|
||||
private async void tbShadowRadius_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
await UpdatePreview();
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace ShareX.MediaLib
|
|||
public int Padding { get; set; }
|
||||
public bool SmartPadding { get; set; }
|
||||
public int RoundedCorner { get; set; }
|
||||
public int ShadowSize { get; set; }
|
||||
public int ShadowRadius { get; set; }
|
||||
public int ShadowOpacity { get; set; }
|
||||
public int ShadowDistance { get; set; }
|
||||
public int ShadowAngle { get; set; }
|
||||
|
@ -58,7 +58,7 @@ namespace ShareX.MediaLib
|
|||
Padding = 40;
|
||||
SmartPadding = true;
|
||||
RoundedCorner = 20;
|
||||
ShadowSize = 30;
|
||||
ShadowRadius = 30;
|
||||
ShadowOpacity = 100;
|
||||
ShadowDistance = 0;
|
||||
ShadowAngle = -90;
|
||||
|
@ -97,11 +97,11 @@ namespace ShareX.MediaLib
|
|||
resultImage = resultImageNew;
|
||||
}
|
||||
|
||||
if (ShadowOpacity > 0 && (ShadowSize > 0 || ShadowDistance > 0))
|
||||
if (ShadowOpacity > 0 && (ShadowRadius > 0 || ShadowDistance > 0))
|
||||
{
|
||||
float shadowOpacity = ShadowOpacity / 100f;
|
||||
Point shadowOffset = (Point)MathHelpers.DegreeToVector2(ShadowAngle, ShadowDistance);
|
||||
resultImage = ImageHelpers.AddShadow(resultImage, shadowOpacity, ShadowSize, 0f, ShadowColor, shadowOffset, false);
|
||||
resultImage = ImageHelpers.AddShadow(resultImage, shadowOpacity, ShadowRadius, 0f, ShadowColor, shadowOffset, false);
|
||||
}
|
||||
|
||||
switch (BackgroundType)
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 577 B |
Binary file not shown.
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 603 B |
Loading…
Reference in New Issue