Results 1 to 5 of 5

Thread: pixel color

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    2

    pixel color

    i was wondering if there is a way to read the colors of pixels outside of the active form, assuming the form is not covering the wanted area of the screen?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: pixel color

    Welcome to the forums.

    What do you mean by "outside of the active form"?

  3. #3
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: pixel color

    You can do that using various API calls. I'll leave it to someone more familiar with these to give an example. Perhaps a mod could move this to the API forum?

  4. #4
    Addicted Member
    Join Date
    Apr 2004
    Location
    sweden
    Posts
    176

    Re: pixel color

    Hey,
    Is this what you are looking for?
    declares:
    Code:
    Private Declare Function GetPixel Lib "gdi32" (ByVal Hdc As Long, ByVal x As Long, ByVal y As Long) As Long
    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Code:
    MsgBox GetPixel(GetDC(0), 1, 1)'0 = handle of desktop

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    2

    Re: pixel color

    yeah its workin now thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width