Exemplo n.º 1
0
        public BytePixels(Microsoft.Xna.Framework.Graphics.Texture2D t2d)
        {
            var tp = new TexturePlus(t2d);

            _size = new SizeInt32(tp.Width, tp.Height);
            _data = (byte[])tp.GetData().Data.Clone();
            _Bpp  = _data.Length / _size.Total;
        }
Exemplo n.º 2
0
        public static TexturePlus operator +(TexturePlus a, TexturePlus b)
        {
            var tp = new TexturePlus(a.GraphicsDevice, a.Width + b.Width, a.Height);
            var wh = (a.Width + b.Width) * a.Height;

            var colors = new Microsoft.Xna.Framework.Color[wh];
            var ca     = new Microsoft.Xna.Framework.Color[a.Width * a.Height];
            var cb     = new Microsoft.Xna.Framework.Color[b.Width * a.Height];

            a.GetData <Microsoft.Xna.Framework.Color>(ca);
            colors.CopyTo(ca, 0);
            b.GetData <Microsoft.Xna.Framework.Color>(cb);
            colors.CopyTo(cb, a.Width * a.Height);

            tp.SetData(colors);
            return(tp);
        }
Exemplo n.º 3
0
 public BytePixels(TexturePlus tp)
 {
     _size = new SizeInt32(tp.Width, tp.Height);
     _data = (byte[])tp.GetData().Data.Clone();
     _Bpp  = _data.Length / _size.Total;
 }