pija
2013-08-04 01:05:24
This article explains how and why GetPixel is so slow
http://en.morzel.net/post/2011/04/05/Why-the-use-of-GetPixel-and-SetPixel-is-so-inefficient!.aspx
This article explains an implementation on how to substitute GetPixel
http://www.codeproject.com/Articles/617613/Fast-pixel-operations-in-NET-with-and-without-unsa
This image is pretty cool:
http://en.morzel.net/pics/PostImg/victorias_900x506.jpg
Now, I don't know much about graphics, so I was lead to believing that reading a screen took so much time, that in order to implement real time screenscraping, you needed to lose accuracy with that weird SPS implementation that compares the sum of all colours within an array of pixels, rather than comparing pixel by pixel.
Apparently it is not needed.
This guy made a program that read and created an image mask from a 7680x4320 HD image in 360ms.
If instead of using GetPixel we used the method described in the article, perhaps we could search for color from a screen scrape fast enough to avoid using SPS' 'Areas', which cause so much inaccuracy.
If you don't know what I'm talking about, try using simba's getcolor for every pixel on the screen to create a bitmap ( if you don't know how, just save The color value of each pixel in an array).
You'll see how long it takes, it shouldn't take so long.
http://en.morzel.net/post/2011/04/05/Why-the-use-of-GetPixel-and-SetPixel-is-so-inefficient!.aspx
This article explains an implementation on how to substitute GetPixel
http://www.codeproject.com/Articles/617613/Fast-pixel-operations-in-NET-with-and-without-unsa
This image is pretty cool:
http://en.morzel.net/pics/PostImg/victorias_900x506.jpg
Now, I don't know much about graphics, so I was lead to believing that reading a screen took so much time, that in order to implement real time screenscraping, you needed to lose accuracy with that weird SPS implementation that compares the sum of all colours within an array of pixels, rather than comparing pixel by pixel.
Apparently it is not needed.
This guy made a program that read and created an image mask from a 7680x4320 HD image in 360ms.
If instead of using GetPixel we used the method described in the article, perhaps we could search for color from a screen scrape fast enough to avoid using SPS' 'Areas', which cause so much inaccuracy.
If you don't know what I'm talking about, try using simba's getcolor for every pixel on the screen to create a bitmap ( if you don't know how, just save The color value of each pixel in an array).
You'll see how long it takes, it shouldn't take so long.