home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c06 / modal / xtrafunc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  380 b   |  34 lines

  1. #include "stdafx.h"
  2.  
  3. #include "XtraFunc.h"
  4.  
  5. int RgbToInt(COLORREF c)
  6. {
  7.     switch(c)
  8.     {
  9.         case RED:
  10.             return 1;
  11.         case GREEN:
  12.             return 2;
  13.         case BLUE:
  14.             return 3;
  15.         default:
  16.             return 0;
  17.     }    
  18. }
  19.  
  20. COLORREF IntToRgb(int r)
  21. {
  22.     switch(r)
  23.     {
  24.         case 1:
  25.             return RED;
  26.         case 2:
  27.             return GREEN;
  28.         case 3:
  29.             return BLUE;
  30.         default:
  31.             return BLACK;
  32.     }    
  33. }
  34.