CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: RGB

  1. #1
    Guest

    RGB

    Hi,
    I have some list of RGB colors given like RGB(255,0,0) or any which i need to convert it in Standar Color number. Please try assist.

    Thanks


  2. #2
    Join Date
    May 1999
    Posts
    8

    Re: RGB

    You can either use a color mask or just bit shift.

    I like bit shifting. Say Red is 170, Green is 100, Blue is 40.

    DWORD bitcolor = (red << 16) + (green << 8) + blue;

    Thats it, hope this helps.
    Regards,
    Abadon.






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

Featured