CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Location
    Netherlands
    Posts
    4

    Question Trouble using RGB values with System.Color

    I want to use RGB color values in GDI+ objects like the Pen etc. This is because I must be able to read files that carry RGB information.
    So far I have been unable to find out how this can be done. First I thought setting the A,R,G,B properties of a System.Color structure would do the job, but of course then I found that these were read-only.

    Does anybody have an idea?

    Thanks
    Manfred

  2. #2
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    265
    Try this:
    Code:
    Color col = Color.FromArgb( alpha, red, green, blue );
    Dunno why they made it a factory method instead of just a plain constructor.

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