Adjust with framework-side screenchanges

This commit is contained in:
smoogipoo
2018-08-17 14:30:44 +09:00
parent 5ddef1afed
commit 9a1e92800b

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using System;
using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -19,6 +18,7 @@ using osu.Game.Configuration;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using SixLabors.ImageSharp;
namespace osu.Game.Graphics namespace osu.Game.Graphics
{ {
@ -90,7 +90,7 @@ namespace osu.Game.Graphics
waitDelegate.Cancel(); waitDelegate.Cancel();
} }
using (var bitmap = await host.TakeScreenshotAsync()) using (var image = await host.TakeScreenshotAsync())
{ {
Interlocked.Decrement(ref screenShotTasks); Interlocked.Decrement(ref screenShotTasks);
@ -102,10 +102,10 @@ namespace osu.Game.Graphics
switch (screenshotFormat.Value) switch (screenshotFormat.Value)
{ {
case ScreenshotFormat.Png: case ScreenshotFormat.Png:
bitmap.Save(stream, ImageFormat.Png); image.SaveAsPng(stream);
break; break;
case ScreenshotFormat.Jpg: case ScreenshotFormat.Jpg:
bitmap.Save(stream, ImageFormat.Jpeg); image.SaveAsJpeg(stream);
break; break;
default: default:
throw new ArgumentOutOfRangeException(nameof(screenshotFormat)); throw new ArgumentOutOfRangeException(nameof(screenshotFormat));