31 lines
813 B
C#
31 lines
813 B
C#
using System.Drawing.Imaging;
|
|
using Dalamud.Configuration;
|
|
|
|
namespace Screenie;
|
|
|
|
[Serializable]
|
|
public class Configuration : IPluginConfiguration {
|
|
public int Version { get; set; } = 1;
|
|
|
|
public string SaveDirectory = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "Screenie");
|
|
public Format SaveFormat = Format.Png;
|
|
public int SaveFormatData = 90;
|
|
}
|
|
|
|
public enum Format {
|
|
Png,
|
|
Webp,
|
|
Jpg,
|
|
}
|
|
|
|
public static class FormatExt {
|
|
public static ImageFormat ToImageFormat(this Format format) {
|
|
return format switch {
|
|
Format.Png => ImageFormat.Png,
|
|
Format.Webp => ImageFormat.Webp,
|
|
Format.Jpg => ImageFormat.Jpeg,
|
|
_ => throw new ArgumentOutOfRangeException(nameof(format), format, null),
|
|
};
|
|
}
|
|
}
|