TextureProcess.Jpgbytes2Bitmap C# (CSharp) Method

Jpgbytes2Bitmap() private method

private Jpgbytes2Bitmap ( byte jpg ) : Bitmap
jpg byte
return Bitmap
    Bitmap Jpgbytes2Bitmap(byte[] jpg)
    {
        ManagedImage mi;
        if (!OpenJPEG.DecodeToImage(jpg, out mi)) return null;
        byte[] imageBytes = mi.ExportTGA();

        using (MemoryStream byteData = new MemoryStream(imageBytes))
        {
            return LoadTGAClass.LoadTGA(byteData);
        }
    }