我已经尝试了几个小时来解决这个问题。当它执行时,它将一直运行,直到系统内存不足。我尝试处理使用后创建的 bmp,它没有任何区别。我还尝试处理 webbrowser,但随后我需要在具有正确高度/宽度等的循环上运行网页以捕获它。我尝试创建一个新的网络浏览器,它循环然后处理的所有内容,但它不会工作。谁能看到这里可能发生的事情?
循环:
wbcondor1.AllowNavigation = true;
wbcondor1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wbcondor1_DocumentCompleted);
wbcondor1.Navigate("blanked out");
文件完成
private void wbcondor1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
Bitmap condor1bmp = new Bitmap(600, 1000);
wbcondor1.DrawToBitmap(condor1bmp, new Rectangle(wbcondor1.Location.X, wbcondor1.Location.Y, wbcondor1.Width, wbcondor1.Height));
if (Convert.ToString(condor1bmp.GetPixel(553, 558)) == "Color [A=255, R=232, G=30, B=48]") { c1to1.Text = "lower"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 584)) == "Color [A=255, R=232, G=30, B=48]") { c1to2.Text = "lower"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 608)) == "Color [A=255, R=232, G=30, B=48]") { c1to3.Text = "lower"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 633)) == "Color [A=255, R=232, G=30, B=48]") { c1to4.Text = "lower"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 658)) == "Color [A=255, R=232, G=30, B=48]") { c1to5.Text = "lower"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 558)) == "Color [A=255, R=0, G=175, B=88]") { c1to1.Text = "higher"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 584)) == "Color [A=255, R=0, G=175, B=88]") { c1to2.Text = "higher"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 608)) == "Color [A=255, R=0, G=175, B=88]") { c1to3.Text = "higher"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 633)) == "Color [A=255, R=0, G=175, B=88]") { c1to4.Text = "higher"; }
if (Convert.ToString(condor1bmp.GetPixel(553, 658)) == "Color [A=255, R=0, G=175, B=88]") { c1to5.Text = "higher"; }
// bmp.Save("condor1.gif");
condor1bmp.Dispose();
}
谢谢大家,希望有人能看到我所缺少的:(