Results 1 to 5 of 5
  1. #1

    pixel color in a screen

    Hi all

    i was unable to get background color of a table cell in a power builder application.

    I was able to get backgroud color of a text field. in similar way i need background color of a table cell.

    or i can plan for work around if i am able to retrive color of a particular pixel on screen.

    Thanks in advance..

  2. #2

    Re: pixel color in a screen

    You'd better try to retreive particular pixel of the screen as you decided (do you need the code for this?). It is the most universal solution. The only thing you need to do to prepare such checking is to be sure that you have Windows classic style appearance (if you use WindowsXP). Some pixel colors are not the same as expected while using WinXP style

  3. #3

    Re: pixel color in a screen

    Can you please share the code for this.

  4. #4

    Re: pixel color in a screen

    It would be nice if you place the code in the following topic..." Donate a user defined function to this topic "


  5. #5

    Re: pixel color in a screen

    This is it:
    <font class="small">Code:</font><hr /><pre>
    [+] dll "user32.dll"
    [ ] HDC GetDC(HWND hWND)
    [+] dll "gdi32.dll"
    [ ] INT GetPixel(HDC hDC, INT x, INT y)
    </pre><hr />

    These are GDI functions. To retreive pixel color of some window, for ex. wSomeWin, at the predefined coordinates you need to write the following

    iColor = GetPixel(GetDC(wSomeWin.hWnd),x,y)

    where iColor - variable to retreive color value to
    x,y - coordinates of the window to retreive color from (relative to left-top corner).



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:12 PM.

Copyright BetaSoft Inc.