X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ce369e6876c49ad7a101ad222048bd5446b7125..a84ece11fffdde5d1bbd254ba58ac3cee79c2e77:/docs/latex/wx/htdcrend.tex diff --git a/docs/latex/wx/htdcrend.tex b/docs/latex/wx/htdcrend.tex index 42858c8b0f..4897caba25 100644 --- a/docs/latex/wx/htdcrend.tex +++ b/docs/latex/wx/htdcrend.tex @@ -3,60 +3,56 @@ % htmprint.h at 17/Oct/99 12:48:02 % - \section{\class{wxHtmlDCRenderer}}\label{wxhtmldcrenderer} -This class can render HTML document into specified area of DC. You can use it -in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting} +This class can render HTML document into a specified area of a DC. You can use it +in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting} or \helpref{wxHtmlPrintout}{wxhtmlprintout} is strongly recommended. - \wxheading{Derived from} \helpref{wxObject}{wxobject} +\wxheading{Include files} + \latexignore{\rtfignore{\wxheading{Members}}} - \membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer} \func{}{wxHtmlDCRenderer}{\void} Constructor. - \membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc} -\func{void}{SetDC}{\param{wxDC* }{dc}, \param{int }{maxwidth}} +\func{void}{SetDC}{\param{wxDC* }{dc}, \param{double }{pixel\_scale = 1.0}} Assign DC instance to the renderer. +{\it pixel\_scale} can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics. +(Many dimensions in HTML are given in pixels -- e.g. image sizes. 300x300 image would be only one +inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.) + \wxheading{Parameters} \docparam{maxwidth}{width of the area (on this DC) that is equivalent to screen's width, in pixels (you should set it to page width minus margins). -{\bf Note:} In current implementation -screen width is always 800 pixels : it gives best results and ensures (almost) same printed outputs +{\bf Note:} In the current implementation +the screen width is always 800 pixels: it gives best results and ensures (almost) same printed outputs across platforms and differently configured desktops.} -Also see \helpref{SetSize}{wxhtmldcrenderersetsize} - - +See also \helpref{SetSize}{wxhtmldcrenderersetsize}. \membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize} \func{void}{SetSize}{\param{int }{width}, \param{int }{height}} Set size of output rectangle, in pixels. Note that you {\bf can't} change -width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}! +width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}! (You can freely change height.) -If you set width equal to maxwidth then HTML is rendered as if it were displayed in fullscreen. -If you set width = 1/2 maxwidth the it is rendered as if it covered half the screen -and so on. - \membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext} @@ -65,10 +61,9 @@ and so on. Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws the text onto DC. - \wxheading{Parameters} -\docparam{html}{HTML text. (NOT file!)} +\docparam{html}{HTML text. This is {\it not} a filename.} \docparam{basepath}{base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.} @@ -76,7 +71,6 @@ file). It is used to determine path for loading images, for example.} \docparam{isdir}{FALSE if basepath is filename, TRUE if it is directory name (see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)} - \membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender} \func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = FALSE}} @@ -85,10 +79,8 @@ Renders HTML text to the DC. \wxheading{Parameters} - \docparam{x,y}{ position of upper-left corner of printing rectangle (see \helpref{SetSize}{wxhtmldcrenderersetsize})} - \docparam{from}{y-coordinate of the very first visible cell} \docparam{dont\_render}{if TRUE then this method only returns y coordinate of the next page @@ -98,32 +90,24 @@ Returned value is y coordinate of first cell than didn't fit onto page. Use this value as {\it from} in next call to Render in order to print multipages document. - \wxheading{Caution!} -Following 3 methods {\bf must} always be called before any call to Render (preferably +The Following three methods {\bf must} always be called before any call to Render (preferably in this order): -\begin{itemize} - +\begin{itemize}\itemsep=0pt \item \helpref{SetDC}{wxhtmldcrenderersetdc} \item \helpref{SetSize}{wxhtmldcrenderersetsize} \item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext} - \end{itemize} -{\bf Render() changes DC's user scale and does NOT restore it!!} - - +{\bf Render() changes the DC's user scale and does NOT restore it.} \membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight} \func{int}{GetTotalHeight}{\void} -Returns height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize}) +Returns the height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize}) is smaller that total height and thus the page cannot fit into it. In that case you're supposed to -call \helpref{Render}{wxhtmldcrendererrender} as long as it's return value is smaller than GetTotalHeight's. - - - +call \helpref{Render}{wxhtmldcrendererrender} as long as its return value is smaller than GetTotalHeight's.