diff options
author | Emmanuel Hansen <emmausssss@gmail.com> | 2024-08-31 14:32:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-31 11:32:53 -0300 |
commit | e0acde04bb032fd056904b909b3fd00c1a6fb996 (patch) | |
tree | c3f146228712153af6f277e0e874d83a56b31d06 /src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs | |
parent | 3c61d560c39d6edf897183fe33b8047c25d2d895 (diff) |
Replace ImageSharp with SkiaSharp everywhere (#7030)1.1.1381
* replace ImageSharp with SkiaSharp for inline keyboard applet rendering
* fix avalonia inline keyboard input
* remove image sharp from gtk3 project
* add skiasharp linux assets
* fix whitespace
* fix format
* fix ico image offset when saving shortcut to windows
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs')
-rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs b/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs index 91a8958e..bf0c7e9d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs @@ -1,10 +1,10 @@ using Ryujinx.Common.Memory; using Ryujinx.HLE.HOS.Services.Caps.Types; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.PixelFormats; +using SkiaSharp; using System; using System.IO; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Security.Cryptography; namespace Ryujinx.HLE.HOS.Services.Caps @@ -118,7 +118,11 @@ namespace Ryujinx.HLE.HOS.Services.Caps } // NOTE: The saved JPEG file doesn't have the limitation in the extra EXIF data. - Image.LoadPixelData<Rgba32>(screenshotData, 1280, 720).SaveAsJpegAsync(filePath); + using var bitmap = new SKBitmap(new SKImageInfo(1280, 720, SKColorType.Rgba8888)); + Marshal.Copy(screenshotData, 0, bitmap.GetPixels(), screenshotData.Length); + using var data = bitmap.Encode(SKEncodedImageFormat.Jpeg, 80); + using var file = File.OpenWrite(filePath); + data.SaveTo(file); return ResultCode.Success; } |