VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Render rich text to any device context

by William Keith (4 Submissions)
Category: Graphics
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

Recently I found myself wanting more than what DrawText could offer: I wanted to be able to render rich text. Rather than write a function for this myself, I wondered whether I could accomplish this with a RichTextBox, and quite simply in fact. Unfortunately it doesn't render text transparently usually. Unless, that is, you set the WS_EX_TRANSPARENT style, at which point it does render transparently, giving you unlimited text drawing power! Note that the method used to get the RichTextBox to actually draw the text (that is sending it EM_FORMATRANGE) can also be used to measure the text with a slight modification (MSDN will tell you how).

API Declarations
Quite a few.

Rate Render rich text to any device context

Download Render rich text to any device context

Download Render rich text to any device context (153 KB)

Render rich text to any device context Comments

No comments have been posted about Render rich text to any device context. Why not be the first to post a comment about Render rich text to any device context.

Post your comment

Subject:
Message:
0/1000 characters