private Image Get_Image(String link) { Web.Web wb = new Web.Web(); MemoryStream stream = new MemoryStream(wb.Get_Image_in_Byte(link)); Image img = new Bitmap(Image.FromStream(stream), new Size(50, 70)); return(img); }
private void Load_Anime_List() { List <Data.Data.Anime> list2 = new List <Data.Data.Anime>(Data.Data.list); int num_anime_not_found = 0; foreach (Data.Data.Anime a1 in list2) { Set_Text("Sprawdzanie anime o tytule: " + a1.title); if (!Check_Anime(a1)) { num_anime_not_found++; } } int row = 1; foreach (Data.Data.Anime a1 in Data.Data.new_episodes) { byte[] imageData = wb.Get_Image_in_Byte(a1.image_url); if (imageData != null) { MemoryStream stream = new MemoryStream(imageData); Image img = Image.FromStream(stream); tableLayoutPanel1.Controls.Add(new PictureBox { Image = img, Height = 70, Width = 50, Anchor = AnchorStyles.Top, SizeMode = PictureBoxSizeMode.StretchImage }, 0, row); } else { tableLayoutPanel1.Controls.Add(new Label { Text = "Brak okładki", AutoSize = true, ForeColor = Color.Orange, Font = new Font(Font.FontFamily, 14), Dock = DockStyle.Top, TextAlign = ContentAlignment.MiddleCenter }, 0, row); } tableLayoutPanel1.Controls.Add(new Label { Text = a1.title, AutoSize = true, ForeColor = Color.Yellow, Font = new Font(Font.FontFamily, 14), Dock = DockStyle.Top, TextAlign = ContentAlignment.MiddleCenter }, 1, row); tableLayoutPanel1.Controls.Add(new Label { Text = (a1.num_watched + 1).ToString(), AutoSize = false, ForeColor = Color.Yellow, Font = new Font(Font.FontFamily, 14), Dock = DockStyle.Top, TextAlign = ContentAlignment.MiddleCenter }, 2, row); LinkLabel l1 = new LinkLabel { Text = "Link do odcinka", AutoSize = true, ForeColor = Color.Yellow, Font = new Font(Font.FontFamily, 14), Dock = DockStyle.Top, TextAlign = ContentAlignment.MiddleCenter }; l1.Click += ((sender, args) => System.Diagnostics.Process.Start(a1.link_to_epiosde)); tableLayoutPanel1.Controls.Add(l1, 3, row); row++; } tableLayoutPanel1.Refresh(); Set_Text("Statystyki Nowe odcinki: " + Data.Data.new_episodes.Count() + " Ilość Anime na MALu: " + Data.Data.list.Count() + " Nie znalezione anime: " + num_anime_not_found); }