示例#1
0
        public UserTileBinaryReader(Stream stream, UserTileBinary userTile)
        {
            if (stream == null) throw new ArgumentNullException("stream");
            if (userTile == null) throw new ArgumentNullException("userTile");

            this.stream = stream;
            this.userTile = userTile;
        }
示例#2
0
        public static UserTileBinary LoadFrom(Stream stream)
        {
            if (stream == null) throw new ArgumentNullException("stream");

            var result = new UserTileBinary();
            var reader = new UserTileBinaryReader(stream, result);
            reader.Read();
            return result;
        }
示例#3
0
文件: Program.cs 项目: vbfox/UserTile
        static void SetUserTile(string userName, string path)
        {
            var userTile = new UserTileBinary { Format = "bmp", SourcePath = path };

            userTile.SetImageData(Image.FromFile(path));

            var userTileData = new MemoryStream();
            userTile.SaveTo(userTileData);
            SetUserTileData(userName, userTileData.ToArray());
        }