c# – How do I compare two images & recognize the pattern in an image? – Stack Overflow
You might be looking for this System.Drawing.Bitmap sourceImage = (Bitmap)Bitmap.FromFile(@"C:\SavedBMPs\1.jpg"); System.Drawing.Bitmap template = (Bitmap)Bitmap.FromFile(@"C:\SavedBMPs\2.jpg"); // create template matching algorithm’s instance // (set similarity threshold to 92.5%)
I warn you it is quite slow takes around 6 seconds to process image of 1024×768 finding in it pciture with the size of 50×50. |
c# WebBrowser开发参考资料 – love_may555的专栏 – 博客频道 – CSDN.NET
其次,如果我们想执行一段Web页面中原本没有的脚本,该怎么做呢?这次.Net的类没有提供,看来还要依靠COM了。IHTMLWindow2可以将任意的字符
串作为脚本代码来执行。
string scriptline01 = @"function ShowPageInfo() {“;
string scriptline02 = @" var numLinks = document.links.length; “;
string scriptline03 = @" var numForms = document.forms.length; “;
string scriptline04 = @" var numImages = document.images.length; “;
string scriptline05 = @" var numScripts = document.scripts.length; “;
string scriptline06 = @" alert(‘网页的统计结果:/r/n链接数:’ + numLinks + “;
string scriptline07 = @" ‘/r/n表单数:’ + numForms + “;
string scriptline08 = @" ‘/r/n图像数:’ + numImages + “;
string scriptline09 = @" ‘/r/n脚本数:’ + numScripts);}";
string scriptline10 = @"ShowPageInfo();";
string strScript = scriptline01 + scriptline02 + scriptline03 + scriptline04 + scriptline05 +
scriptline06 + scriptline07 + scriptline08 + scriptline09 + scriptline10;
IHTMLWindow2 win = (IHTMLWindow2)webBrowser.Document.Window.DomWindow;
win.execScript(strScript, “Javascript");http://www.xmlasp.net/n1670c13.aspx