public override Stream Pack(ref Stream data) { // Convert the bitmap to a pvr try { PvrTextureEncoder TextureEncoder = new PvrTextureEncoder(data, PixelFormat, DataFormat); TextureEncoder.EnableGbix(GbixHeader); if (GbixHeader) TextureEncoder.WriteGbix(GlobalIndex); if (CompressionFormat != PvrCompressionFormat.None) TextureEncoder.SetCompressionFormat(CompressionFormat); return TextureEncoder.GetTextureAsStream(); } catch { return null; } }