in reply to Alternate for GetPixel

Maybe you can use Win32::GUI::DIBitmap (in particular newFromDC(...)), instead of making a separate call for every single pixel... — Sounds like it might do what you want (can't try it myself at the moment, no Windows box within reach).

Replies are listed 'Best First'.
Re^2: Alternate for GetPixel
by michbach (Sexton) on Mar 08, 2009 at 17:23 UTC
    Hi almut, that looks good on the first fly! Now i have to study how to use it. Thanks!!!

    Update:
    Hi almut! I tried to find a faster way with Win32::GUI::DIBitmap but without success! There is also the same slow function getpixel. I have read in another forum following about getpixel:
    "..but what do you thing GetPixel() is doing internally? Each time you call it, it must first read the header, get the bits, calculate the size of a pixel, calculate the the size of a row, calculate which row, calculate how far into that row, get the pixel, convert it to a COLORREF then give it back to you. ALL FOR ONE PIXEL! This is for every single call. Use a DIB and access the bits directly ....."

    I guess i need an access directly to the memory-adresses to get the information of the pixels faster.. But i dont know how i can make it :-(

    best regards, michbach
      I tried to find a faster way with Win32::GUI::DIBitmap but without success!

      What exactly have you tried (could you post the code)?  How did it fail (error message, wrong result (if so, which?), ...)?

      (sorry for the late reply — hadn't seen the update before this moment)