Drawing The Focus

This is a discussion on Drawing The Focus within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I'm trying to draw what amounts to six filled focus rectangles. They need to be drawn in such a ...

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,263

    Drawing The Focus

    Hello,

    I'm trying to draw what amounts to six filled focus rectangles. They need to be drawn in such a way that they're always visible, regardless of the background colour. The problem I'm coming up against is when the background colour is grey (RGB 128 128 128). NOTing that gives you effectively the same colour, and XOR is all well and good but it doesn't seem work in all cases.

    Currently I'm using:-
    Code:
    PatBlt(hdc, x, y, width, height, PATINVERT);
    This XORs the colours of the selected brush (the default, black) with the rectangle indicated. The result is invisible with a grey background. Changing the brush to white makes no difference, so a change in ROP code is in order I believe.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Sounds like grey is a special case. How about NOT in some cases and XOR in other cases?

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Slow drawing code
    By tjpanda in forum Windows Programming
    Replies: 5
    Last Post: 05-09-2008, 05:09 PM
  2. Changing focus in an MFC Application
    By rangalo in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2005, 06:21 AM
  3. Focus Messages?
    By PsychoBrat in forum Windows Programming
    Replies: 5
    Last Post: 12-30-2003, 06:14 AM
  4. Drawing focus rectangles
    By SMurf in forum Windows Programming
    Replies: 1
    Last Post: 07-29-2002, 08:53 AM
  5. Focus & Always-On-Top :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 06-13-2002, 05:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21