mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add JPEG screenshot quality setting
This commit is contained in:
@ -19,6 +19,7 @@ using osu.Game.Input.Bindings;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||
|
||||
namespace osu.Game.Graphics
|
||||
{
|
||||
@ -33,6 +34,7 @@ namespace osu.Game.Graphics
|
||||
public IBindable<bool> CursorVisibility => cursorVisibility;
|
||||
|
||||
private Bindable<ScreenshotFormat> screenshotFormat;
|
||||
private Bindable<int> screenshotJpegQuality;
|
||||
private Bindable<bool> captureMenuCursor;
|
||||
|
||||
[Resolved]
|
||||
@ -51,6 +53,7 @@ namespace osu.Game.Graphics
|
||||
this.storage = storage.GetStorageForDirectory(@"screenshots");
|
||||
|
||||
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
|
||||
screenshotJpegQuality = config.GetBindable<int>(OsuSetting.ScreenshotJpegQuality);
|
||||
captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
|
||||
|
||||
shutter = audio.Samples.Get("UI/shutter");
|
||||
@ -119,7 +122,7 @@ namespace osu.Game.Graphics
|
||||
break;
|
||||
|
||||
case ScreenshotFormat.Jpg:
|
||||
image.SaveAsJpeg(stream);
|
||||
image.SaveAsJpeg(stream, new JpegEncoder { Quality = screenshotJpegQuality.Value });
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user