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

Threaded View

  1. #1
    Join Date
    Feb 2003
    Location
    AR
    Posts
    228

    Convert system color to RGB

    How can I convert a color constant (such as vbWindowBackground) to RGB? The method I'm now using (see below) only works with colors retrieved from a CommonDialog color dialog selector.

    Code:
    RVal = Int(lSourceColor Mod 256)
    GVal = Int((lSourceColor \ 256) Mod 256)
    BVal = lSourceColor \ 65536
    But this doesn't work with when lSourceColor is a system color constant. Do I have to convert the color to another format before using that RGB function? How?
    Last edited by Andrex; December 25th, 2006 at 12:02 AM.

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