This is my opr for c# you need to include Code (C#): <div class="csharp" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Drawing</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Windows</span>.<span style="color: #0000FF;">Forms</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li></ol></div> In this example I used a little gui made of 1 boutton and 1 picture box... Code (C#): <div class="csharp" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>.<span style="color: #0000FF;">Generic</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">ComponentModel</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Data</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Drawing</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Windows</span>.<span style="color: #0000FF;">Forms</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">namespace</span> OPR</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â <span style="color: #0600FF;">public</span> partial <span style="color: #FF0000;">class</span> Form1 : Form</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #0600FF;">public</span> Form1<span style="color: #000000;">(</span><span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â InitializeComponent<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> btnImage_Click<span style="color: #000000;">(</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Bitmap neopetPicture = <span style="color: #000000;">(</span>Bitmap<span style="color: #000000;">)</span> picBox.<span style="color: #0000FF;">Image</span>; Â Â Â Â Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #FF0000;">int</span> Â now = Â DateTime.<span style="color: #0000FF;">Now</span>.<span style="color: #0000FF;">Millisecond</span> ;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #FF0000;">int</span> width = neopetPicture.<span style="color: #0000FF;">Width</span>, height = neopetPicture.<span style="color: #0000FF;">Height</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Color unPixel = Color.<span style="color: #0000FF;">White</span> Â ; Â Â Â Â Â <span style="color: #008080; font-style: italic;">// pixel de comparaison </span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Color darkPixel = Color.<span style="color: #0000FF;">White</span> Â ; Â Â Â Â Â Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #FF0000;">int</span> coodX = <span style="color: #FF0000;">0</span>, coodY = <span style="color: #FF0000;">0</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #0600FF;">for</span> <span style="color: #000000;">(</span><span style="color: #FF0000;">int</span> a = <span style="color: #FF0000;">0</span>; a < height; a += <span style="color: #FF0000;">10</span><span style="color: #000000;">)</span> <span style="color: #008080; font-style: italic;">//Here we find teh dark pixel</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â <span style="color: #0600FF;">for</span> <span style="color: #000000;">(</span><span style="color: #FF0000;">int</span> b = <span style="color: #FF0000;">0</span>; b < width; b += <span style="color: #FF0000;">10</span><span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â unPixel = neopetPicture.<span style="color: #0000FF;">GetPixel</span><span style="color: #000000;">(</span>b, a<span style="color: #000000;">)</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â <span style="color: #0600FF;">if</span> <span style="color: #000000;">(</span>unPixel.<span style="color: #0000FF;">GetBrightness</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> < darkPixel.<span style="color: #0000FF;">GetBrightness</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â Â Â darkPixel = unPixel;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â Â Â coodX = b;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â Â Â coodY = a;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â <span style="color: #FF0000;">int</span> fin = DateTime.<span style="color: #0000FF;">Now</span>.<span style="color: #0000FF;">Millisecond</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â MessageBox.<span style="color: #0000FF;">Show</span><span style="color: #000000;">(</span><span style="color: #808080;">"The neopet is at :"</span>+ coodX.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #808080;">", "</span> + coodY.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>+<span style="color: #808080;">" and was found in "</span> + <span style="color: #000000;">(</span>fin-now<span style="color: #000000;">)</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> +<span style="color: #808080;">" ms."</span><span style="color: #000000;">)</span>;<span style="color: #008080; font-style: italic;">//shows cood</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â <span style="color: #0600FF;">for</span> <span style="color: #000000;">(</span><span style="color: #FF0000;">int</span> p = <span style="color: #FF0000;">0</span>; p < width - <span style="color: #FF0000;">1</span>; p++<span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â neopetPicture.<span style="color: #0000FF;">SetPixel</span><span style="color: #000000;">(</span>p, coodY, Color.<span style="color: #0000FF;">White</span><span style="color: #000000;">)</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #0600FF;">for</span> <span style="color: #000000;">(</span><span style="color: #FF0000;">int</span> k = <span style="color: #FF0000;">0</span>; k < height - <span style="color: #FF0000;">1</span>; k++<span style="color: #000000;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #000000;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â Â Â neopetPicture.<span style="color: #0000FF;">SetPixel</span><span style="color: #000000;">(</span>coodX, k, Color.<span style="color: #0000FF;">White</span><span style="color: #000000;">)</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â picBox.<span style="color: #0000FF;">Image</span> = neopetPicture;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â <span style="color: #000000;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #000000;">}</span></li></ol></div> Here some picture of the result 1- the gui interface... 2- where where he says the neopet is... 3- the time it took
Nice script, could be improved my threading it and having thread 1 check even rows, thread 2 check odd rows. Of course this is assuming you have a multithreaded processor.