+ Reply to Thread
Results 1 to 3 of 3

How to read pixel color

  1. #1
    Registered User
    Join Date
    01-21-2005
    Posts
    1

    How to read pixel color

    Hi,
    How can I in Excels WorkSheet objects such as PlotArea or Shape using VBA and API determine pixel color at given coordinates. API function GetPixel requires handler - hdc so do Excels objects possess hdc and how can I get it? Or maybe there is another way to read pixel color ?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Keram,

    You would need the window handle (hWnd) of the chart to get the Device Context Handle (hDC) using the API. However, I believe the Chart is Owner Drawn which means there is no exposed handle to retrieve directly through Excel's objects or using the API calls. Sorry.

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    12-11-2004
    MS-Off Ver
    2007
    Posts
    137
    Hello

    It's not exactly what you need but in the link below you will find a zipped workbook named "Palette_Couleurs_V01.zip " ( sorry... in french )

    in the UserForm there is a Checkbox to have the pixel color at the coordonates of the mouse cursor (converts RGB , Long & Hex ) .informations are refreshed every second during Checkbox=true


    http://www.excel-downloads.com/html/...009_132009.htm


    regards
    michel

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1