Exemplo n.º 1
0
        public static DirectBitmap ASTCTextureToBitmap(Texture2D texture, byte[] data)
        {
            int          width     = texture.Width;
            int          height    = texture.Height;
            int          blockSize = texture.ASTCBlockSize();
            DirectBitmap bitmap    = new DirectBitmap(width, height);

            try
            {
                AstcDecoder.DecodeASTC(data, width, height, blockSize, blockSize, bitmap.Bits);
                return(bitmap);
            }
            catch
            {
                bitmap.Dispose();
                throw;
            }
        }