Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Feb 22nd, 2005, 5:49 PM   #1
jarrod
Newbie
 
Join Date: Feb 2005
Posts: 1
Rep Power: 0 jarrod is on a distinguished road
Printing rich text with colored background

Hello,

I am displaying the contents of a rich text control on the printer using the EM_FORMATRANGE message. I would like for the text to be drawn over a colored background. However, it appears that during the processing of the EM_FORMATRANGE message a white rectangle gets drawn behind the text, spanning the width of the bounding rectangle and extending down to the last line of text. I have tried setting the background color of the graphics device context using SetBkColor, tried setting the background brush of the rich text control's client area using SetWindowLong, and tried changing the character format of the control using the EM_SETCHARFORMAT message. While changing the character format does draw the correct background color behind the printed text, the white rectangles still appear.

Maybe I'm doing something wrong, but I'm about to give up on the EM_FORMATRANGE message and draw the text myself. Does anybody know of the correct way to draw rich text over an arbitrary color?

BTW: If I draw to a bitmap, everything works fine.

Thanks in advance,
Jarrod
jarrod is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:10 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC