예제 #1
0
            public override int GetHashCode()
            {
                var hashCode = 674255106;

                hashCode = hashCode * -1521134295 + HPos.GetHashCode();
                hashCode = hashCode * -1521134295 + VPos.GetHashCode();
                hashCode = hashCode * -1521134295 + HSize.GetHashCode();
                hashCode = hashCode * -1521134295 + VSize.GetHashCode();
                return(hashCode);
            }
예제 #2
0
파일: SKore.cs 프로젝트: xnumad/Tanji
        /// <summary>
        /// Returns the avatar image of a specified size generated with the given figured id in an asynchronous operation.
        /// </summary>
        /// <param name="figureId">The figured id of the avatar.</param>
        /// <param name="size">The output size of the avatar image.</param>
        public static async Task <Bitmap> GetAvatarAsync(string figureId, HSize size)
        {
            using (var client = new WebClient())
            {
                client.Proxy = null;
                client.Headers[HttpRequestHeader.UserAgent] = ChromeAgent;

                byte[] bitmapData = await client.DownloadDataTaskAsync(
                    $"https://www.habbo.com/habbo-imaging/avatarimage?size={(char)size}&figure={figureId}");

                using (var bitmapStream = new MemoryStream(bitmapData))
                    return((Bitmap)Image.FromStream(bitmapStream));
            }
        }