Exemple #1
0
        public void FillArray(ref NetArray <int, NetInt> oArray)
        {
            oArray.Clear();
            MemoryStream ms = StardewThreadSafeLoader.GetTextureMS("FillArray", Texture());

            //Texture().SaveAsPng(ms, SourceImage.Width, SourceImage.Height);
            foreach (byte bBtyte in ms.ToArray())
            {
                oArray.Add(bBtyte);
            }
        }
Exemple #2
0
        public NetArray <int, NetInt> TextureNetArray()
        {
            //
            //  probably not the most efficient method but it
            //  provides the ability to passs textures between
            //  multiplayer players
            //
            NetArray <int, NetInt> arReturn = new NetArray <int, NetInt>();
            MemoryStream           ms       = new MemoryStream();

            Texture().SaveAsPng(ms, SourceImage.Width, SourceImage.Height);
            foreach (byte bBtyte in ms.ToArray())
            {
                arReturn.Add(bBtyte);
            }

            return(arReturn);
        }