Merge remote-tracking branch 'smoogipoo/screenshot-fix' into update-framework

This commit is contained in:
Dean Herbert 2018-08-20 13:38:07 +09:00
commit e982901205
1 changed files with 4 additions and 4 deletions

View File

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