Search code examples
rubyuser-interfacewinapigetpixel

Why GetPixel() is so slow using Ruby (or probably Perl or Python too) and how to do it by other methods?


I tried using Win32's GetPixel() with Ruby and it is really slow even on a Quad Core Intel machine. I think for example, if I get a really small region such as 100 x 10 pixels = 1000 pixels and it can take 30 seconds to complete. Is there a better way such as by getting a region all at once?


Solution

  • I think the function you want is BitBlt.