Obtaining RGB from HBRUSH

This is a discussion on Obtaining RGB from HBRUSH within the Windows Programming forums, part of the Platform Specific Boards category; I'd like to be able to obtain the RGB values from an HBRUSH, a sort of resverse-CreateSolidBrush() function. I'm sure ...

  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.
    benforbes@optusnet.com.au
    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,831
    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.
    benforbes@optusnet.com.au
    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, 01: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-21-2004, 11:42 PM
  5. '=' : cannot convert from 'void *' to 'struct HBRUSH__ *'
    By Bajanine in forum Windows Programming
    Replies: 9
    Last Post: 10-14-2002, 07:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21