From 4e7b0767197bc59a6ad2ced34966faab831aae12 Mon Sep 17 00:00:00 2001 From: Jaex Date: Tue, 6 Feb 2018 12:39:42 +0300 Subject: [PATCH] Remember sticker size --- ShareX.ScreenCaptureLib/Forms/StickerForm.cs | 7 +++++-- ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs | 3 +++ .../Shapes/Drawing/StickerDrawingShape.cs | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Forms/StickerForm.cs b/ShareX.ScreenCaptureLib/Forms/StickerForm.cs index 647483ee1..fc85934da 100644 --- a/ShareX.ScreenCaptureLib/Forms/StickerForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/StickerForm.cs @@ -43,8 +43,10 @@ public partial class StickerForm : Form private string[] imageFiles; - public StickerForm() + public StickerForm(int imageSize = 64) { + ImageSize = imageSize; + InitializeComponent(); Icon = ShareXResources.Icon; tsMain.Renderer = new CustomToolStripProfessionalRenderer(); @@ -52,8 +54,9 @@ public StickerForm() tsnudSize.NumericUpDownControl.Maximum = 256; tsnudSize.NumericUpDownControl.Increment = 16; tsnudSize.NumericUpDownControl.TextAlign = HorizontalAlignment.Center; + tsnudSize.NumericUpDownControl.SetValue(ImageSize); ilvStickers.SetRenderer(new StickerImageListViewRenderer()); - ilvStickers.ThumbnailSize = new Size(64, 64); + ilvStickers.ThumbnailSize = new Size(ImageSize, ImageSize); tscbStickers.SelectedIndex = 0; LoadImageFiles("blobs"); diff --git a/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs b/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs index 074c2a50e..62e5e619d 100644 --- a/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs +++ b/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs @@ -82,6 +82,9 @@ public class AnnotationOptions public int StepFontSize { get; set; } = 18; public bool StepUseLetters { get; set; } = false; + // Sticker drawing + public int StickerSize { get; set; } = 64; + // Blur effect public int BlurRadius { get; set; } = 15; diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/StickerDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/StickerDrawingShape.cs index 322d3d2cd..8fcf980d1 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/StickerDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/StickerDrawingShape.cs @@ -50,10 +50,12 @@ public override void OnCreating() try { - using (StickerForm stickerForm = new StickerForm()) + using (StickerForm stickerForm = new StickerForm(AnnotationOptions.StickerSize)) { if (stickerForm.ShowDialog() == DialogResult.OK) { + AnnotationOptions.StickerSize = stickerForm.ImageSize; + if (!string.IsNullOrEmpty(stickerForm.SelectedImageFile)) { Image img = ImageHelpers.LoadImage(stickerForm.SelectedImageFile);