mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-30 00:10:36 +00:00
25 lines
652 B
C#
25 lines
652 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Toolbox.Library
|
|
{
|
|
public class ImageUtilty
|
|
{
|
|
public static byte[] ConvertBgraToRgba(byte[] bytes)
|
|
{
|
|
if (bytes == null)
|
|
throw new Exception("Data block returned null. Make sure the parameters and image properties are correct!");
|
|
|
|
for (int i = 0; i < bytes.Length; i += 4)
|
|
{
|
|
var temp = bytes[i];
|
|
bytes[i] = bytes[i + 2];
|
|
bytes[i + 2] = temp;
|
|
}
|
|
return bytes;
|
|
}
|
|
}
|
|
}
|