Page 1 of 1

Off-screen rendering

Posted: Thu Jan 10, 2008 9:35 am
by MIKLEI
Can RichView (or reportHelper) be used for rendering text completely off-screen, without any forms?

What I'd like to do is to load some formatted text from a memory stream, and draw that onto a memory DC (from a Direct3D9 surface), preferrably in a worker thread.

Is this possible? Any samples or demos?

Another question: is there a function to get a paragraph's bounding rectangle in pixels?

Posted: Thu Jan 10, 2008 12:46 pm
by Sergey Tkachenko
In the latest version (available for registered users), TRVReportHelper does not require forms (can be created without parent or placed on datamodule). But I doubt that VCL components can work in thread properly.

As for the paragraph coordinates, can you explain what you want to implement? I'll try to suggest a solution.

Off-screen rendering

Posted: Thu Jan 10, 2008 1:04 pm
by MIKLEI
VCL components can be made thread safe (for example TThread...), though TControl descendants are not, I think. Well never mind then.

I'd need paragraph coordinates to apply different special fx to different paragraphs - for example, nothing to paragraph 0, glow effect to paragraph 1, etc. Not very important though.

This is just an idea so far, I'm looking for a component that would allow some more typograhic control over rendering text than just win api DrawText.

Posted: Thu Jan 10, 2008 4:32 pm
by Sergey Tkachenko
You can use OnDrawParaBack and OnDrawStyleText to draw additional effects for paragraphs and text.
See Demos\Delphi\Assorted\CustomDraw\CustomDraw\