Colorref

This is a discussion on Colorref within the Game Programming forums, part of the General Programming Boards category; Hello all, one of my sample programs has Code: SetTextColor(hDC, COLORREF(0x00FF0000)); in it. I know how this works and what ...

  1. #1
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

    Colorref

    Hello all, one of my sample programs has

    Code:
    SetTextColor(hDC, COLORREF(0x00FF0000));
    in it. I know how this works and what it is, i was just wondering if theres a well known site listing the values/colors they represent? I'm downloading and working with code so i don't really have time to look right now, so i figured i'd ask..thnx for the help.

  2. #2
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    You could go into photoshop and set the color there, and copy and paste the hex value it outputs in the little box. I'm not sure if paint does this, though, if you don't have photoshop.

  3. #3
    fuh
    fuh is offline
    Attack hamster fuh's Avatar
    Join Date
    Dec 2002
    Posts
    176
    It gives me white (like the text box I'm typing in right now!) in Macromedia Fireworks.
    ~Fuh
    Stupid things pop singers say

    "I get to go to lots of overseas places, like Canada."
    - Britney Spears

    "I love what you've done with the place!"
    -Jessica Simpson upon meeting the Secretary of Interior during tour of the White House

  4. #4
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    i have PS, thnx for the idea:

    the hex i pasted is blue, fuh.

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    You do know about the RGB macro right? That returns a COLORREF...

    Code:
    RGB( 255, 0, 0 );
    For pure red. Each is an unsigned char ( 0 - 255 ). Enjoy.

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,659
    COLORREF is just a typedef of an integer. Since an int is 4 bytes and each color is 1 byte then we are just packing the three colors into the COLORREF variable so to store and transport it easier.



    ITSA
    Socket Library!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. COLORREF GetPixel(); Help
    By JordanCason in forum C++ Programming
    Replies: 10
    Last Post: 11-20-2007, 11:23 PM
  2. Extracting COLORREF
    By Queatrix in forum Windows Programming
    Replies: 2
    Last Post: 12-20-2006, 11:41 AM
  3. colorref and setpixel
    By bballzone in forum C++ Programming
    Replies: 19
    Last Post: 09-11-2004, 06:09 PM
  4. Odd program crashes
    By Mithoric in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2004, 10:37 PM
  5. Making COLORREF lighter
    By Mithoric in forum Windows Programming
    Replies: 1
    Last Post: 03-02-2004, 03:32 AM

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