hello there,
im trying to access System.Drawing.Color using reflection to get every RGB value of the colors within it, so i can use those values in other projects without having to copy them by hand.
what i wanted to do was creating a c++ header with something like:
now within that enum i would like to have every color that is on the Color class in System.Drawing assembly.Code:namespace Colors { enum Colors_ { Red = RGB( 255, 0, 0 ), Blue = RGB( 0, 0, 255 ), ... }; }
ive tried using C# something like:
so if anyone has ideias, please share themCode:public static void Main() { StreamWriter out = new StreamWriter( "Colors.h" ); MemberInfo [] members = typeof(System.Drawing.Color).GetMembers(); foreach( MemberInfo in members ) { out.WriteLine( m.Name + " = RGB( " //and now i dont know how to get the R G and B value of the color being read
thanks![]()




Reply With Quote