Available in the LEADTOOLS Imaging toolkit. |
RGBfromHSV example for C++ 4.0 and later
//Takes an HSV, displays the HSV components, and displays the RGB components
void CColorReplaceDlg::HSVtoRGB(int nH, int nS, int nV)
{
COLORREF cr;
int nRed, nGreen, nBlue;
char szMsg[100];
cr = m_Lead.RGBfromHSV(nH, nS, nV);
nRed = GetRValue(cr);
nGreen = GetGValue(cr);
nBlue = GetBValue(cr);
wsprintf(szMsg, "HSV(%d,%d,%d) is RGB(%d,%d,%d)", nH, nS, nV, nRed, nGreen, nBlue);
::MessageBox(NULL, szMsg, "", MB_OK);
}