private void SaveImage() { string CorrectURL = ""; List <string> collectedURLS = new List <string>(); WebClient w = new WebClient(); string s = w.DownloadString(poe_lab_diff_url); // Collect all urls foreach (LinkItem i in LinkFinder.Find_SRC(s)) { if (i.Href != null) { Console.WriteLine(i.Href); collectedURLS.Add(i.Href); } } // find wanted url foreach (string link in collectedURLS) { if (link.Contains("poelab.com/wp-content/uploads") && link.Contains(poe_lab_diff) && link.Contains(".")) { CorrectURL = link; } } var request = WebRequest.Create(CorrectURL); using (var response = request.GetResponse()) using (var stream = response.GetResponseStream()) { int x = 302, y = 111, width = 841, height = 270; Bitmap source = (Bitmap)Image.FromStream(stream); Bitmap CroppedImage = source.Clone(new System.Drawing.Rectangle(x, y, width, height), source.PixelFormat); Bitmap NewImage = ChangeOpacity(CroppedImage, float.Parse(Settings.Opacity.Value.ToString()) / 100); CurrentFileName = GetUniqueKey(25); NewImage.Save(PluginDirectory + $"\\images\\{CurrentFileName}.png", ImageFormat.Png); } }