private async void UpdateThumbnail(PictureBox pb, String name) { pb.Image = null; pb.AccessibleName = name; if (name == "Forma Blueprint") { pb.Image = Image.FromFile("Forma2.png"); } else { Bitmap b = await dh.GetItemThumbnail(name); if (pb.AccessibleName == name) { pb.Image = b; } } }
private async void CreateNewItemDisplay(Point origin, String name, int count, float price, bool unknown = false) { PictureBox Icon = new PictureBox(); Icon.Location = origin; Icon.SizeMode = PictureBoxSizeMode.Zoom; pnlInv.Controls.Add(Icon); Label lname = new Label(); lname.Location = new Point(origin.X, origin.Y + Icon.Height + 10); lname.TextAlign = ContentAlignment.MiddleCenter; lname.AutoSize = true; pnlInv.Controls.Add(lname); Label plattext = new Label(); plattext.Location = new Point(origin.X, origin.Y + Icon.Height + 40); plattext.TextAlign = ContentAlignment.MiddleCenter; plattext.AutoSize = true; pnlInv.Controls.Add(plattext); lname.Text = name; if (unknown) { lname.AutoSize = false; lname.Width = 125; plattext.Text = "Error: Unknown Item!"; } else { plattext.Text = count.ToString() + "(Total) * " + price.ToString() + "(Price) " + " = " + (count * price).ToString("N1"); Icon.Image = await dh.GetItemThumbnail(name); } }