Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8766253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:30:20+00:00 2026-06-13T16:30:20+00:00

System.Drawing.Color has a private field int state which makes equality a bit more tricky

  • 0

System.Drawing.Color has a private field int state which makes equality a bit more tricky than one would expect from a struct.

Anyone know what on earth it’s for? Who, what and why sets and reads it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:30:21+00:00Added an answer on June 13, 2026 at 4:30 pm

    As far as i understand, it is compared to theese values:

        private static short StateKnownColorValid   = 0x0001;
        private static short StateARGBValueValid    = 0x0002;
        private static short StateValueMask         = (short)(StateARGBValueValid);
        private static short StateNameValid         = 0x0008;
        private static long NotDefinedValue = 0;
    

    http://reflector.webtropy.com/default.aspx/Net/Net/3@5@50727@3053/DEVDIV/depot/DevDiv/releases/whidbey/netfxsp/ndp/fx/src/CommonUI/System/Drawing/Color@cs/1/Color@cs

    So my shot is that its used to dertermine if its a “System Color” or a user defined from e.g. ARGB values.

    public bool IsKnownColor 
    {
        get { return((state & StateKnownColorValid) != 0);}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the System.Drawings System.Drawing.FontFamily.Families brings me up more families than the ones supported for
Has anyone written a nice extension method 'library' for System.Drawing.Color. Would be nice to
My domain model is using System.Net.Uri to represent URLs, and System.Drawing.Color to represent colors.
How can I convert a System.Windows.Media.Brush to System.Drawing.Brush? I'm trying to get the color
I'm using System.Drawing.Color, is there anything in Visual Studio that can display the color
I need to convert a System.Windows.Media.SolidcolorBrush to a System.Drawing.Color in C# any clues would
I have a system which is drawing points into a QwtPlot. What I want
We have a piece of code which saves a .Net System.Drawing.Bitmap to file. The
Here's some code, k.Bind<IGame>().To<Game>().Named(A) .WithConstructorArgument(ColorChoiceCount, 12); iGame = k.Get<IGame>(A); ((Game)iGame).SelectedColor = new GameColor(System.Drawing.Color.Red); iGame
I read that System.Drawing.Point is a value type. I do not understand. Why?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.