pass ColorPicker value to a COLORREF variable
-
hi guys, i'm having problem passing the value of color picker to my COLORREF variable.. my code on KEYDown Event: CGDICarSampleDlg.cpp file /* CColorDialog dlg; if (dlg.DoModal() == IDOK) { color = dlg.GetColor(); } Invalidate(); */ when the color picker apears, i just choose a color,. i created a brush on my Car.cpp file, m_brCar.CreateSolidBrush(RGB(0, 0, 255)); now my problem is this, how do pass whatever the value of chosen color to a COLORREF variable, then pass it to m_brCar.CreateSolidBrush(COLORREF variable);? so when i chose a color, my CAR DRAWING changes it's color, initialy the color is BLUE.. thanks ahead..
-
hi guys, i'm having problem passing the value of color picker to my COLORREF variable.. my code on KEYDown Event: CGDICarSampleDlg.cpp file /* CColorDialog dlg; if (dlg.DoModal() == IDOK) { color = dlg.GetColor(); } Invalidate(); */ when the color picker apears, i just choose a color,. i created a brush on my Car.cpp file, m_brCar.CreateSolidBrush(RGB(0, 0, 255)); now my problem is this, how do pass whatever the value of chosen color to a COLORREF variable, then pass it to m_brCar.CreateSolidBrush(COLORREF variable);? so when i chose a color, my CAR DRAWING changes it's color, initialy the color is BLUE.. thanks ahead..
ok, i resolved it on my own... using these three lines of code i was able to extract the RGB...
r = GetRValue(color); g = GetGValue(color); b = GetBValue(color);
haha... google is a friend, don't be shy to ask GOOGLE..