MCPcopy Create free account
hub / github.com/ColorCop/ColorCop / OnColorPick

Method OnColorPick

ColorCop/ColorCopDlg.cpp:1372–1401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370}
1371
1372void CColorCopDlg::OnColorPick() {
1373 // set up the common windows color dialog
1374 COLORREF temp;
1375 CColorDialog dlgcolor;
1376 dlgcolor.m_cc.rgbResult = RGB(m_Reddec, m_Greendec, m_Bluedec);
1377 dlgcolor.m_cc.Flags = CC_RGBINIT | CC_FULLOPEN;
1378 dlgcolor.m_cc.lpCustColors = CustColorBank; // pointer to custom colors aray
1379
1380 // show the dialog
1381 if (dlgcolor.DoModal() == IDOK) {
1382 // if they pressed OK
1383 temp = dlgcolor.GetColor();
1384
1385 m_Reddec = GetRValue(temp);
1386 m_Greendec = GetGValue(temp);
1387 m_Bluedec = GetBValue(temp);
1388
1389 UpdateData(false);
1390 CalcColorPal();
1391 OnconvertRGB();
1392 OnCopytoclip();
1393 }
1394 // else if they didn't hit OK, do nothing
1395
1396 // just to be safe..
1397 if (m_isEyedropping || m_isMagnifying) {
1398 StopCapture();
1399 m_isEyedropping = m_isMagnifying = FALSE;
1400 }
1401}
1402
1403void CColorCopDlg::OnCopytoclip() {
1404 if (m_Appflags & AutoCopytoClip) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected