How do I generate a System::Drawing::Color array?
-
Hi guys, I want to make an array that consists of system defined colors. I wrote the code
System::Drawing::Color Color1[]={Color::Black, Color::Brown, Color::Red};
what delivered the error 'System::Drawing::Color' : a native array cannot contain this managed type Then I tried this versionColor Color1[] = __gc new Color[];
and I got this error error C2440: 'initializing' : cannot convert from 'System::Drawing::Color ^' to 'System::Drawing::Color' Has anyone an idea how to make this work? Thanks and best wishes -
Hi guys, I want to make an array that consists of system defined colors. I wrote the code
System::Drawing::Color Color1[]={Color::Black, Color::Brown, Color::Red};
what delivered the error 'System::Drawing::Color' : a native array cannot contain this managed type Then I tried this versionColor Color1[] = __gc new Color[];
and I got this error error C2440: 'initializing' : cannot convert from 'System::Drawing::Color ^' to 'System::Drawing::Color' Has anyone an idea how to make this work? Thanks and best wishesGoing from the
'System::Drawing::Color ^'
I would guess that you'd get more help in the Managed C++ / CLI forum than here. Certainly my help would be rubbish - I'm a MFC/Win32 fossil. Iain.Iain Clarke appearing in spite of being begged not to by CPallini.
-
Hi guys, I want to make an array that consists of system defined colors. I wrote the code
System::Drawing::Color Color1[]={Color::Black, Color::Brown, Color::Red};
what delivered the error 'System::Drawing::Color' : a native array cannot contain this managed type Then I tried this versionColor Color1[] = __gc new Color[];
and I got this error error C2440: 'initializing' : cannot convert from 'System::Drawing::Color ^' to 'System::Drawing::Color' Has anyone an idea how to make this work? Thanks and best wishes -
Hi guys, I want to make an array that consists of system defined colors. I wrote the code
System::Drawing::Color Color1[]={Color::Black, Color::Brown, Color::Red};
what delivered the error 'System::Drawing::Color' : a native array cannot contain this managed type Then I tried this versionColor Color1[] = __gc new Color[];
and I got this error error C2440: 'initializing' : cannot convert from 'System::Drawing::Color ^' to 'System::Drawing::Color' Has anyone an idea how to make this work? Thanks and best wishesYour choice for aks this question on this forum was wrong you must ask Managed C++/CLI[^]. :)