VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Render rich text to any device context

William Keith  (4 Submissions)   Graphics   Advanced   Wed 3rd February 2021

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 (2(2 Vote))

Download Render rich text to any device context

Render rich text to any device context Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters