Re: Drawing HTML text



"Alex Blekhman" <tkfx.N05P4M@xxxxxxxxx> wrote in message
news:dk7ekh$asv$1@xxxxxxxxxxxxxxxxx

> Do you want to display HTML formatted input in your program or to
> be able to edit HTML document visually (akin to "Design" mode of
> Visual Studio HTML editor)?....

Thanks Alex.

Further specification of the problem is in order:

Picture a CMyDocument derived from CDocument, which is a map,
showing coastline, roads, towns, etc. Each town has a name
(CString), a rectangle (CRect) in which to draw the name, and a font
(LOGFONT) - all members of CMyDocument.

In CMyView::OnDraw() and CMyView::OnPrint() the map (and place
names) are drawn on the supplied DC.

The place names are *currently* drawn with:

pDC->DrawText( "My Place Name", ..., &rectangle, ...);

What I *want* is something equivalent for HTML formated text:

pDC->DrawHtml(
"<html>
<head>...</head>
<body>
My <b>Place</b> <em>Name</em>
</body>
</html>",
.... &rectangle, ..);

Would be nice if it existed!.

So how to do it?

A CHtmlView doesn't seem right as the labels are only small
components of the document.

On the screen I suppose I could create transparent, CHtmlEditCtrl's
as child windows over my CMyView, occupying the appropriate
rectangles, each with its own DC and and each rendering its own
text.

But I can't see that printing my document could be achieved like
that.

What would be nice is an HTML renderer into a given rectangle on a
given DC.

>...
> Process of rendering and displaying HTML content is up to
> WebBrowser control entirely. You don't need to draw it yourself.

That is what I wanted but, as far as I can see, there is no way to
pass it a CDC *, and CRect *, and tell it - "put it there!"

Or is there?

Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm



.



Relevant Pages

  • Re: Drawing HTML text
    ... be able to edit HTML document visually?.... ... On the screen I suppose I could create transparent, CHtmlEditCtrl's as child windows over my CMyView, occupying the appropriate rectangles, each with its own DC and and each rendering its own text. ... What would be nice is an HTML renderer into a given rectangle on a given DC. ... You don't need to draw it yourself. ...
    (microsoft.public.vc.language)
  • Re: Access displaying HTML
    ... You may be able to buy an add-in that does it for you, though most of the ones I'm aware of actually used RTF rather than HTML. ... The simplest solution would be to upgrade to Access 2010, and the built-in text box can now display HTML. ... Allen Browne - Microsoft MVP. ... >>> I have a field of text written in html and stored in a memo field. ...
    (microsoft.public.access.queries)
  • Re: Delphi Blogsphere
    ... > It needs to be able to display HTML, ... > where it is accepted practice to post using HTML. ... by posting a message with a syntax error in the script. ...
    (borland.public.delphi.non-technical)
  • Re: Thanks to All (Was: MUA & Yahoo)
    ... would help it to display HTML as they are supposed to be rendered. ... CLAWS which is a Sylpheed spinoff does have ways to display HTML ... The browser you prefer can be set in Configuration> Common ... I have mine set to google chrome '%s'. ...
    (Debian-User)
  • Re: Thanks to All (Was: MUA & Yahoo)
    ... would help it to display HTML as they are supposed to be rendered. ... CLAWS which is a Sylpheed spinoff does have ways to display HTML ... The browser you prefer can be set in Configuration> Common ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)