Off-screen rendering

General TRichView support forum. Please post your questions here
Post Reply
MIKLEI
Posts: 7
Joined: Thu Jan 10, 2008 9:24 am

Off-screen rendering

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
MIKLEI
Posts: 7
Joined: Thu Jan 10, 2008 9:24 am

Off-screen rendering

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can use OnDrawParaBack and OnDrawStyleText to draw additional effects for paragraphs and text.
See Demos\Delphi\Assorted\CustomDraw\CustomDraw\
Post Reply