Click here to Skip to main content
15,918,976 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDate Time object for win 32 dll Pin
Laser113-Aug-05 13:29
Laser113-Aug-05 13:29 
GeneralRe: Date Time object for win 32 dll Pin
Laser113-Aug-05 13:32
Laser113-Aug-05 13:32 
GeneralRe: Date Time object for win 32 dll Pin
Ravi Bhavnani13-Aug-05 15:54
professionalRavi Bhavnani13-Aug-05 15:54 
GeneralRe: Date Time object for win 32 dll Pin
Saurabh.Garg13-Aug-05 15:58
Saurabh.Garg13-Aug-05 15:58 
GeneralRe: Date Time object for win 32 dll Pin
David Crow15-Aug-05 3:36
David Crow15-Aug-05 3:36 
GeneralLaunching another app from C++ program Pin
Laser113-Aug-05 13:21
Laser113-Aug-05 13:21 
GeneralRe: Launching another app from C++ program Pin
David Crow13-Aug-05 15:57
David Crow13-Aug-05 15:57 
GeneralText color from background color Pin
Ravi Bhavnani13-Aug-05 12:05
professionalRavi Bhavnani13-Aug-05 12:05 
Does anyone know of a reliable formula that returns a text color that appropriately contrasts a background color? Even something as coarse as black or white will suffice - a la:
COLORREF getTextColor
  (COLORREF rgbBkgColor)
{
  if (...)
     return (RGB (0, 0, 0));
  return (RGB (255, 255, 255));
}
Unfortunately the standard brightness formula doesn't appear to be accurate for all colors.
int nBrightness = (GetRValue (rgbBkg) * 299 +
                   GetGValue (rgbBkg) * 587 +
                   GetBValue (rgbBkg) * 114) / 1000;
Thanks,

/ravi

My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com

GeneralRe: Text color from background color Pin
cpprules13-Aug-05 12:39
cpprules13-Aug-05 12:39 
GeneralRe: Text color from background color Pin
Ravi Bhavnani14-Aug-05 5:04
professionalRavi Bhavnani14-Aug-05 5:04 
GeneralRe: Text color from background color Pin
John R. Shaw13-Aug-05 18:40
John R. Shaw13-Aug-05 18:40 
GeneralRe: Text color from background color Pin
Ravi Bhavnani14-Aug-05 5:04
professionalRavi Bhavnani14-Aug-05 5:04 
GeneralSolution Pin
Ravi Bhavnani14-Aug-05 5:02
professionalRavi Bhavnani14-Aug-05 5:02 
GeneralRe: Solution Pin
Jack Puppy14-Aug-05 10:39
Jack Puppy14-Aug-05 10:39 
GeneralRe: Solution Pin
Ravi Bhavnani15-Aug-05 1:54
professionalRavi Bhavnani15-Aug-05 1:54 
GeneralRe: Solution Pin
Ravi Bhavnani15-Aug-05 16:57
professionalRavi Bhavnani15-Aug-05 16:57 
GeneralTask List problem Pin
cpprules13-Aug-05 11:52
cpprules13-Aug-05 11:52 
GeneralRe: Task List problem Pin
John R. Shaw13-Aug-05 19:14
John R. Shaw13-Aug-05 19:14 
GeneralRe: Task List problem Pin
S. Senthil Kumar14-Aug-05 3:37
S. Senthil Kumar14-Aug-05 3:37 
GeneralRe: Task List problem Pin
S. Senthil Kumar14-Aug-05 3:39
S. Senthil Kumar14-Aug-05 3:39 
GeneralManaging Memory Pin
deus78913-Aug-05 11:49
deus78913-Aug-05 11:49 
GeneralRe: Managing Memory Pin
John R. Shaw13-Aug-05 19:49
John R. Shaw13-Aug-05 19:49 
GeneralRe: Managing Memory Pin
S. Senthil Kumar14-Aug-05 3:45
S. Senthil Kumar14-Aug-05 3:45 
GeneralCAsyncSocket Pin
xSoptik13-Aug-05 10:18
xSoptik13-Aug-05 10:18 
GeneralRe: CAsyncSocket Pin
S Douglas15-Aug-05 1:47
professionalS Douglas15-Aug-05 1:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.