Hello guys, I thought it would help some people that are still learning. An avatar viewer is pretty basic but funny to use. Step 1: You'll need to open Microsoft Visual Studio and select C# as the language. Step 2: You'll need to choose "Windows Form Application" and name it as "Avatar Viewer" if you want to. Spoiler Step 3: Once you choosed the windows form application and you clicked okay, wait until the code is fully loaded and then add a groupBox called "Search". And add to it a label called "Gamertag:" and put a textBox to be able to type the gamertag. After that, add a button called "Begin searching". It should look like this: Spoiler Step 4: Add another groupBox but this time, call it "Avatar" and add to it a pictureBox. There should be a little arrow in top right. Click on the little arrow and click "Dock in Parent Container.". Then change the "SizeMode" to "CenterImage". It should look like this: Spoiler Step 5: Click on the button called "Begin searching". Step 6: Add the following code to it: try { pictureBox1.ImageLocation = "http://avatar.xboxlive.com/avatar/" + textBox1.Text + "/avatar-body.png#.USkt3x02aIM"; } catch { MessageBox.Show("Your avatar couldn't be retrieved"); } If the gamertag isn't available, it will pop up a little window saying "Your avatar couldn't be retrieved". If it works correctly, it should look like this: Spoiler Thanks and I hope that it helps you! Off topic: Major Nelson has a pretty nice avatar .
If you have any question about this then feel free to hit me up. But anyways, I doubt you guys will have questions about this lol..
That's because you only have Visual Basic (VB) , you'll need to upgrade to Visual Studio to add the other languages
For VB.NET its... Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click PictureBox1.ImageLocation = "http://avatar.xboxlive.com/avatar/" + TextBox1.Text + "/avatar-body.png#.USkt3x02aIM" End Sub End Class great tutorial!
Since this is XPG and nothing can go unmodded here's couple more basic things you can do in this or other programs to save some hassle of typing in the info every time Add a .txt file to your project named "Gamertag.txt" and set it's properties to "copy always" // Add this to stream info from txt file using System.IO; // create a link label and make it open your txt for easy editing private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start(Application.StartupPath + "\\Gamertag.txt"); } //Add to the form load ,what and where the file is and where to stream it private void Form1_Load(object sender, EventArgs e) { //Add this so your gamer tag loads from the .txt file textBox1.Text = System.IO.File.ReadAllText(Application.StartupPath + "\\Gamertag.txt"); using (FileStream fileStream = File.OpenRead(Application.StartupPath + "\\Gamertag.txt")) using (StreamReader streamReader = new StreamReader(fileStream)) { string fileContent = streamReader.ReadToEnd(); textBox1.Text = fileContent; } } the result will auto fill your text box upon opening ,and easily edit your .txt file if needed
Thanks for this By the way, could you give me the little XPG image in the corner so I can use it for my future tools?
Thanks for this. Mine came out like crap everytime I tried to do it myself so I succumbed to your C# code.