ShowGammaAdjustmentDlg Example for C++ 5.0 and later

void CDialogs::OnShowGammaAdjustmentDlg()
{
   int nRet; 
   int nGamma = 0; 
   m_pRasterColorDlg->GammaRedValue= 50; 
   m_pRasterColorDlg->GammaGreenValue= 50; 
   m_pRasterColorDlg->GammaBlueValue= 50; 
   m_pRasterColorDlg->EnableGammaAllChannels= true; 
   m_pRasterColorDlg->UIFlags = GAMMAADJUSTMENT_SHOW_PREVIEW |
                               GAMMAADJUSTMENT_SHOW_TOOL_ZOOMLEVEL |
                               GAMMAADJUSTMENT_FORCELINKCHANNELS ; 
   
   m_pRasterColorDlg->Bitmap =  m_LeadRasterView.GetRaster().GetBitmap ();
   
   nRet =m_pRasterColorDlg->ShowGammaAdjustmentDlg ((long)this->m_hWnd); 
   if ( nRet == 0 && m_pRasterColorDlg->DialogStatus == DLG_OK ) 
   {
      nGamma = (m_pRasterColorDlg->GammaRedValue +
               m_pRasterColorDlg->GammaGreenValue +
               m_pRasterColorDlg->GammaBlueValue)/3; 
      
      m_pRasterProc->GammaCorrect (m_LeadRasterView.GetRaster (), nGamma); 
   }