Thread: Obtaining RGB from HBRUSH

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    Obtaining RGB from HBRUSH

    I'd like to be able to obtain the RGB values from an HBRUSH, a sort of resverse-CreateSolidBrush() function. I'm sure it must exist.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Surely you know what the RGB components are when you created the brush, unless it was a system colour, and I showed you how to get that in the other thread.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    76
    Code:
    LOGBRUSH lb;
    GetObject(hbrush,sizeof(LOGBRUSH),&lb);
    Please note that the actual color drawn may be inexact, depending on the color settings.

  4. #4
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    poccil, is this inexactness based on a palette issue? And if so, what recommendations could you make? Not that this is worth much time or effort, but I'd like to know what my options are.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL: Pixel addition
    By Hunter2 in forum Game Programming
    Replies: 4
    Last Post: 12-15-2008, 02:36 PM
  2. x.h header file
    By Ducky in forum Windows Programming
    Replies: 11
    Last Post: 11-01-2008, 11:12 AM
  3. Wm_timer
    By Ducky in forum Windows Programming
    Replies: 21
    Last Post: 09-26-2008, 05:36 AM
  4. Stopwatch program (need help!)
    By modnar in forum C Programming
    Replies: 9
    Last Post: 03-22-2004, 12:42 AM
  5. '=' : cannot convert from 'void *' to 'struct HBRUSH__ *'
    By Bajanine in forum Windows Programming
    Replies: 9
    Last Post: 10-14-2002, 07:54 PM