How to give a constructor color variable initialization
Time:12-30
In the line. H, defines a private member variables Color The class line { Private: Color line_color;//color value Int line_path;//track Int line_width;//line width Public: Vector value;//curve values The line (void); ~ the line (void); The line (TCHAR * m_name, float m_min, float m_max, Color m_line_color, int m_line_path, int m_line_width); Void Set_color (Color line_color);//set colors } In. CPP in the constructor initializes the following: Void line: : Set_color (Color m_line_color)//set colors { This - & gt; Line_color=m_line_color; //this - & gt; Line_color=(m_line_color m_line_color. Red, Green, m_line_color. Blue); } So write if you have any questions? I change Color object behind the line. The set_color (Color (0, 0)) how are not successful ~ ~
CodePudding user response:
1 note function call case After 2 change colors to trigger a redraw can see effect, InvalidateRect RedrawWindow etc.