CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #6
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    Re: FillSolidRect & DrawText

    Quote Originally Posted by Quell
    Hey.

    I recently ran into a problem trying to do some custom drawing in a view. (CScrollView derived). I use FillSolidRect to fill a rectangle, and then DrawText to render some text in OnDraw. The problem is that all of the text is set on the background that i set using FillSolidRect as opposed only to the bit that i defined as.

    Any ideas why?

    Thx in advance.
    Yes, that is the normal behaviour.

    After using FillSolidRect you have to call CDC::SetBkColor to (re-)set the background color for text outputting funtions. Another solution is to set the bk mode to TRANSPARENT (CDC:SetBkMode(TRANSPARENT) ) since you filled the background alredy ...

    Hope this was useful.

    With regards
    Programartist
    Ingo Bochmann
    Last edited by ProgramArtist; June 16th, 2008 at 02:08 AM. Reason: Edit: Someone has been faster ...

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