RGBfromHSV example for C++ 5.0 and later
//Takes an HSV, displays the HSV components, and displays the RGB components
void CRemapHueDlg::HSVtoRGB(int nH, int nS, int nV)
{
OLE_COLOR cr;
int nRed, nGreen, nBlue;
CString strMsg;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)
{
cr = pRasterProc->RGBfromHSV (nH, nS, nV);
nRed = GetRValue(cr);
nGreen = GetGValue(cr);
nBlue = GetBValue(cr);
strMsg.Format(TEXT("HSV(%d,%d,%d) is RGB(%d,%d,%d)"), nH, nS, nV, nRed, nGreen, nBlue);
MessageBox(strMsg);
pRasterProc->Release();
}
}