From a3daa4922884734e882ebae083d68d845c2ef5cc Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 15 Jan 2021 19:42:31 -0800 Subject: [PATCH] add SavePNG method --- src/Texture.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Texture.cs b/src/Texture.cs index 5c34033..cec57d2 100644 --- a/src/Texture.cs +++ b/src/Texture.cs @@ -39,6 +39,14 @@ namespace Campari return texture; } + public unsafe static void SavePNG(string path, int width, int height, byte[] pixels) + { + fixed (byte* ptr = &pixels[0]) + { + Refresh.Refresh_Image_SavePNG(path, width, height, (IntPtr) ptr); + } + } + public static Texture CreateTexture2D( GraphicsDevice device, uint width,