Remember sticker size

This commit is contained in:
Jaex 2018-02-06 12:39:42 +03:00
parent af541e3f8c
commit 4e7b076719
3 changed files with 11 additions and 3 deletions

View file

@ -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");

View file

@ -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;

View file

@ -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);