CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2001
    Posts
    391

    Question Simple Question: XOR a Filled Rectangle? How?

    This is embarassing to ask but i have no idea how to draw a filled rectangle in an XOR way into the DC.

    I have my FillRect(hdc,&rect,hBrush) but when i try using the oldMode = SetROP2(hdcDesktop,R2_XORPEN); it does not XOR. According to MSDN it mentions that the filled interior should now be XORed but it isnt. Any ideas?

    Thanks

  2. #2
    Join Date
    May 2002
    Posts
    1,435

    Re: Simple Question: XOR a Filled Rectangle? How?

    I'm not familiar with this function so I may be totally off-base here, but the documentation seems to indicate that all SetROP2() does is set the mix mode so that subsequent uses of the pen will have the desired effect. It does not appear to be an immediate update function similar to FillRect().

  3. #3
    Join Date
    Dec 2001
    Posts
    391

    Re: Simple Question: XOR a Filled Rectangle? How?

    Quote Originally Posted by 0xC0000005
    I'm not familiar with this function so I may be totally off-base here, but the documentation seems to indicate that all SetROP2() does is set the mix mode so that subsequent uses of the pen will have the desired effect. It does not appear to be an immediate update function similar to FillRect().
    Interesting. I didnt realize that. I hope there is a function to do what want then. I know i can bitblt but i dont want th eextra load of creating a bitmap, mapping to a compatible dc, doing a fillrect into that then bitblt'ing xor...too much for something that should be basic. Thanks for your heads up!

  4. #4
    Join Date
    Dec 2001
    Posts
    391

    Re: Simple Question: XOR a Filled Rectangle? How?

    Hi again..I figured it out..I had to use the PatBlt function instead of FillRect(..) Thanks for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured