So here's a quick and dirty example on how to get this done:
The UserControl:
public partial class ImageWithText : UserControl
{
public ImageWithText(Image image = null, string champName = null)
{
InitializeComponent();
if(image != null)
{
ChampionImage.Image = image;
}
if(!string.IsNullOrEmpty(champName))
{
ChamptionName.Text = champName;
}
}
private void ImageWithText_Load(object sender, EventArgs e)
{
//Get the Width of the usercontrol:
int ucWidth = this.Width;
int centerPoint = ucWidth / 2;
//Place text in the center:
int labelWidth = ChamptionName.Width;
int labelCenter = labelWidth / 2;
//Set the lable to the centerPoint and then shift half of the lable to the left!
//We leave the Top value untouched since we only want to set the HORIZONTAL ALIGNMENT
ChamptionName.Left = centerPoint - labelCenter;
}
public void SetChampionImage(Image image)
{
ChampionImage.Image = image;
ChampionImage.SizeMode = PictureBoxSizeMode.StretchImage;
Application.DoEvents();
}
public void SetChampionName(string name)
{
ChamptionName.Text = name;
Application.DoEvents();
}
}
The Designer Code:
partial class ImageWithText
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ChampionImage = new System.Windows.Forms.PictureBox();
this.ChamptionName = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.ChampionImage)).BeginInit();
this.SuspendLayout();
//
// ChampionImage
//
this.ChampionImage.Location = new System.Drawing.Point(5, 5);
this.ChampionImage.Margin = new System.Windows.Forms.Padding(5);
this.ChampionImage.Name = "ChampionImage";
this.ChampionImage.Size = new System.Drawing.Size(120, 120);
this.ChampionImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.ChampionImage.TabIndex = 0;
this.ChampionImage.TabStop = false;
//
// label1
//
this.ChamptionName.AutoSize = true;
this.ChamptionName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ChamptionName.Location = new System.Drawing.Point(33, 130);
this.ChamptionName.Name = "label1";
this.ChamptionName.Size = new System.Drawing.Size(73, 13);
this.ChamptionName.TabIndex = 1;
this.ChamptionName.Text = "SampleText";
//
// ImageWithText
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.ChamptionName);
this.Controls.Add(this.ChampionImage);
this.Name = "ImageWithText";
this.Size = new System.Drawing.Size(130, 150);
this.Load += new System.EventHandler(this.ImageWithText_Load);
((System.ComponentModel.ISupportInitialize)(this.ChampionImage)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox ChampionImage;
private System.Windows.Forms.Label ChamptionName;
So when I apply this on a Window:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//Create new Instance of UserControl:
//Simple:
ImageWithText champion = new ImageWithText();
//Advanced (pass parameters in construcor):
ImageWithText champion = new ImageWithText(Properties.Resources.Ashe, "Ashe");
//Set Image and Name (if not set in constructor:)
champion.SetChampionName("Ashe");
champion.SetChampionImage(Properties.Resources.Ashe);
//Add to Window:
this.Controls.Add(chamption);
}
}
I get this result:

Riot Games API:
var request = (HttpWebRequest)WebRequest.Create("https://tr.api.pvp.net/api/lol/tr/v1.2/champion?api_key=<YourApiKey>");
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
ChampionList list = Newtonsoft.Json.JsonConvert.DeserializeObject<ChampionList>(responseString);
use the class below: (from http://json2csharp.com/)
public class Champion
{
public int id { get; set; }
public bool active { get; set; }
public bool botEnabled { get; set; }
public bool freeToPlay { get; set; }
public bool botMmEnabled { get; set; }
public bool rankedPlayEnabled { get; set; }
}
public class ChampionList
{
public List<Champion> champions { get; set; }
}
EDIT:
For me it is working.
I stored the reponse you got in a file.

Buttonis has the PropertyTextImageRelationwhere you can handle things like that.