public XnaImageCodecStream ( Microsoft.Xna.Framework.Graphics texture ) : System | ||
texture | Microsoft.Xna.Framework.Graphics | |
리턴 | 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;
}