Axiom.RenderSystems.Xna.XnaImageCodecStream.XnaImageCodecStream C# (CSharp) Method

XnaImageCodecStream() public method

public XnaImageCodecStream ( Microsoft.Xna.Framework.Graphics texture ) : System
texture Microsoft.Xna.Framework.Graphics
return System
        public XnaImageCodecStream( XFG.Texture2D texture )
        {
            //texture = texture;
            byte[] buffer = new byte[ texture.Width * texture.Height * PixelUtil.GetNumElemBytes( XnaHelper.Convert( texture.Format ) ) ];
            texture.GetData( buffer );
            this._stream = new MemoryStream( buffer );
            ImageData.width = texture.Width;
            ImageData.height = texture.Height;
            ImageData.format = XnaHelper.Convert( texture.Format );
            ImageData.numMipMaps = 1;
            ImageData.size = buffer.Length;
        }