mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
First attempt at Realms list retrieval
> See #51 - Realms Support + Catch exception while retrieving player head
This commit is contained in:
parent
6dd003d04c
commit
5654871a57
3 changed files with 65 additions and 19 deletions
|
|
@ -36,9 +36,13 @@ namespace MinecraftClient
|
|||
{
|
||||
using (HttpWebResponse httpWebReponse = (HttpWebResponse)httpWebRequest.GetResponse())
|
||||
{
|
||||
Bitmap skin = new Bitmap(Image.FromStream(httpWebReponse.GetResponseStream())); //Read skin from network
|
||||
skin = skin.Clone(new Rectangle(8, 8, 8, 8), skin.PixelFormat); //Crop skin
|
||||
SetConsoleIcon(skin.GetHicon()); //Set skin as icon
|
||||
try
|
||||
{
|
||||
Bitmap skin = new Bitmap(Image.FromStream(httpWebReponse.GetResponseStream())); //Read skin from network
|
||||
skin = skin.Clone(new Rectangle(8, 8, 8, 8), skin.PixelFormat); //Crop skin
|
||||
SetConsoleIcon(skin.GetHicon()); //Set skin as icon
|
||||
}
|
||||
catch (ArgumentException) { /* Invalid image in HTTP response */ }
|
||||
}
|
||||
}
|
||||
catch (WebException) //Skin not found? Reset to default icon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue