public async void SetImage() { string value = cbbSize.SelectedValue.ToString(); progressBar1.Value = 0; lvMain.Items.Clear(); ImageList iml = new ImageList(); iml.ImageSize = new Size(100, 100); iml.ColorDepth = ColorDepth.Depth16Bit; lvMain.LargeImageList = iml; timer1.Start(); Crawler c = await Crawler.Load(txtKey.Text, value); List <string> img = c.GetImages(); foreach (var it in img) { ItemModel jsItem = JsonConvert.DeserializeObject <ItemModel>(it); jsItems.Add(jsItem); Image _img = await LoadImage.Get(jsItem.tu); iml.Images.Add(jsItem.id, _img); var listViewItem = lvMain.Items.Add(""); listViewItem.ImageKey = jsItem.id; } progressBar1.Value = 1000; timer1.Stop(); }
private async void SetImage() { Image _img = await LoadImage.Get(url); pictureBox1.Image = _img; }