]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/htdcrend.tex
updated legalese regarding libtiff, libjpeg
[wxWidgets.git] / docs / latex / wx / htdcrend.tex
CommitLineData
3ce369e6
VS
1%
2% automatically generated by HelpGen from
3% htmprint.h at 17/Oct/99 12:48:02
4%
5
3ce369e6
VS
6\section{\class{wxHtmlDCRenderer}}\label{wxhtmldcrenderer}
7
448af9a4
JS
8This class can render HTML document into a specified area of a DC. You can use it
9in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting}
3ce369e6
VS
10or \helpref{wxHtmlPrintout}{wxhtmlprintout} is strongly recommended.
11
3ce369e6
VS
12\wxheading{Derived from}
13
14\helpref{wxObject}{wxobject}
15
3ce369e6
VS
16\latexignore{\rtfignore{\wxheading{Members}}}
17
3ce369e6
VS
18\membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer}
19
20\func{}{wxHtmlDCRenderer}{\void}
21
22Constructor.
23
3ce369e6
VS
24\membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc}
25
605d715d 26\func{void}{SetDC}{\param{wxDC* }{dc}, \param{double }{pixel\_scale = 1.0}}
3ce369e6
VS
27
28Assign DC instance to the renderer.
29
605d715d
VS
30{\it pixel\_scale} can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics.
31(Many dimensions in HTML are given in pixels -- e.g. image sizes. 300x300 image would be only one
32inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.)
edbd0635 33
3ce369e6
VS
34\wxheading{Parameters}
35
36\docparam{maxwidth}{width of the area (on this DC) that is equivalent to screen's width,
37in pixels (you should set it to page width minus margins).
38
448af9a4
JS
39{\bf Note:} In the current implementation
40the screen width is always 800 pixels: it gives best results and ensures (almost) same printed outputs
3ce369e6
VS
41across platforms and differently configured desktops.}
42
448af9a4 43See also \helpref{SetSize}{wxhtmldcrenderersetsize}.
3ce369e6
VS
44
45\membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize}
46
47\func{void}{SetSize}{\param{int }{width}, \param{int }{height}}
48
49Set size of output rectangle, in pixels. Note that you {\bf can't} change
448af9a4 50width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}!
3ce369e6 51(You can freely change height.)
3ce369e6 52
3ce369e6
VS
53\membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext}
54
55\func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = TRUE}}
56
57Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws
58the text onto DC.
59
3ce369e6
VS
60\wxheading{Parameters}
61
448af9a4 62\docparam{html}{HTML text. This is {\it not} a filename.}
3ce369e6
VS
63
64\docparam{basepath}{base directory (html string would be stored there if it was in
65file). It is used to determine path for loading images, for example.}
66
67\docparam{isdir}{FALSE if basepath is filename, TRUE if it is directory name
68(see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)}
69
3ce369e6
VS
70\membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender}
71
72\func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = FALSE}}
73
74Renders HTML text to the DC.
75
76\wxheading{Parameters}
77
3ce369e6
VS
78\docparam{x,y}{ position of upper-left corner of printing rectangle (see \helpref{SetSize}{wxhtmldcrenderersetsize})}
79
3ce369e6
VS
80\docparam{from}{y-coordinate of the very first visible cell}
81
82\docparam{dont\_render}{if TRUE then this method only returns y coordinate of the next page
83and does not output anything}
84
85Returned value is y coordinate of first cell than didn't fit onto page.
86Use this value as {\it from} in next call to Render in order to print multipages
87document.
88
3ce369e6
VS
89\wxheading{Caution!}
90
448af9a4 91The Following three methods {\bf must} always be called before any call to Render (preferably
3ce369e6
VS
92in this order):
93
448af9a4 94\begin{itemize}\itemsep=0pt
3ce369e6
VS
95\item \helpref{SetDC}{wxhtmldcrenderersetdc}
96\item \helpref{SetSize}{wxhtmldcrenderersetsize}
97\item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext}
3ce369e6
VS
98\end{itemize}
99
448af9a4 100{\bf Render() changes the DC's user scale and does NOT restore it.}
3ce369e6
VS
101
102\membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight}
103
104\func{int}{GetTotalHeight}{\void}
105
448af9a4 106Returns the height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize})
3ce369e6 107is smaller that total height and thus the page cannot fit into it. In that case you're supposed to
448af9a4 108call \helpref{Render}{wxhtmldcrendererrender} as long as its return value is smaller than GetTotalHeight's.
3ce369e6 109