X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e76b35d73fb5a043fd39af266bd452a6e20a861..24d705907ddcbe8e701867be2fb6f457a3dfab6f:/docs/latex/wx/dc.tex diff --git a/docs/latex/wx/dc.tex b/docs/latex/wx/dc.tex index 43b3a36bb8..d609a8eaec 100644 --- a/docs/latex/wx/dc.tex +++ b/docs/latex/wx/dc.tex @@ -109,7 +109,7 @@ This sequence of operations ensures that the source's transparent area need not and logical functions are supported. {\bf Note:} on Windows, blitting with masks can be speeded up considerably by compiling -wxWindows with the wxUSE\_DC\_CACHE option enabled. You can also influence whether MaskBlt +wxWidgets with the wxUSE\_DC\_CACHE option enabled. You can also influence whether MaskBlt or the explicit mask blitting code above is used, by using \helpref{wxSystemOptions}{wxsystemoptions} and setting the {\bf no-maskblt} option to 1. @@ -383,7 +383,7 @@ The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling. The programmer is responsible for deleting the list of points. -Note that wxWindows automatically closes the first and last points. +Note that wxWidgets automatically closes the first and last points. \pythonnote{The wxPython version of this method accepts a Python list of wxPoint objects.} @@ -395,11 +395,34 @@ of wxPoint objects.} \membersection{wxDC::DrawPolyPolygon}\label{wxdcdrawpolypolygon} -\func{void}{DrawPolyPolygon}{\param{int }{n}, \param{int }{start\[\]}, \param{wxPoint }{points\[\]}, \param{wxCoord }{xoffset}, \param{wxCoord }{yoffset}, \param{int }{fillStyle = \texttt{wxODDEVEN\_RULE}}} +\func{void}{DrawPolyPolygon}{\param{int}{ n}, \param{int}{ count[]}, \param{wxPoint}{ points[]}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0},\\ + \param{int }{fill\_style = wxODDEVEN\_RULE}} + +Draws two or more filled polygons using an array of {\it points}, adding the +optional offset coordinates. + +Notice that for the platforms providing a native implementation +of this function (Windows and PostScript-based wxDC currently), this is more +efficient than using \helpref{DrawPolygon}{wxdcdrawpolygon} in a loop. + +{\it n} specifies the number of polygons to draw, the array {\it count} of size +{\it n} specifies the number of points in each of the polygons in the +{\it points} array. + +The last argument specifies the fill rule: {\bf wxODDEVEN\_RULE} (the default) +or {\bf wxWINDING\_RULE}. -Draw many polygons at once. For the platforms providing a native implementation -of this function (Windows and PostScript-based wxDC), this is more efficient -than using \helpref{DrawPolygon}{wxdcdrawpolygon} in a loop. +The current pen is used for drawing the outline, and the current brush for +filling the shape. Using a transparent brush suppresses filling. + +The polygons maybe disjoint or overlapping. Each polygon specified in a call to +{\bf DrawPolyPolygon} must be closed. Unlike polygons created by the +\helpref{DrawPolygon}{wxdcdrawpolygon} member function, the polygons created by +{\bf DrawPolyPolygon} are not closed automatically. + +\pythonnote{Not implemented yet} + +\perlnote{Not implemented yet} \membersection{wxDC::DrawPoint}\label{wxdcdrawpoint} @@ -637,6 +660,22 @@ Returns true if device context optimization is on. See \helpref{wxDC::SetOptimization}{wxsetoptimization} for details. +\membersection{wxDC::GetPartialTextExtents}\label{wxdcgetpartialtextextents} + +\constfunc{bool}{GetPartialTextExtents}{\param{const wxString\& }{text}, +\param{wxArrayInt\& }{widths}} + +Fills the {\it widths} array with the widths from the begining of +{\it text} to the coresponding character of {\it text}. The generic +version simply builds a running total of the widths of each character +using \helpref{GetTextExtent}{wxdcgettextextent}, however if the +various platforms have a native API function that is faster or more +accurate than the generic implementaiton then it should be used +instead. + +\pythonnote{This method only takes the {\it text} parameter and + returns a Python list of integers.} + \membersection{wxDC::GetPen}\label{wxdcgetpen} \func{wxPen\&}{GetPen}{\void} @@ -645,13 +684,12 @@ See \helpref{wxDC::SetOptimization}{wxsetoptimization} for details. Gets the current pen (see \helpref{wxDC::SetPen}{wxdcsetpen}). - \membersection{wxDC::GetPixel}\label{wxdcgetpixel} \func{bool}{GetPixel}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxColour *}{colour}} -Sets {\it colour} to the colour at the specified location. Windows only; an X implementation -is being worked on. Not available for wxPostScriptDC or wxMetafileDC. +Sets {\it colour} to the colour at the specified location. +Not available for wxPostScriptDC or wxMetafileDC. \pythonnote{For wxPython the wxColour value is returned and is not required as a parameter.} @@ -659,17 +697,20 @@ required as a parameter.} \perlnote{This method only takes the parameters {\tt x} and {\tt y} and returns a Wx::Colour value} +\membersection{wxDC::GetPPI}\label{wxdcgetppi} + +\constfunc{wxSize}{GetPPI}{\void} + +Returns the resolution of the device in pixels per inch. \membersection{wxDC::GetSize}\label{wxdcgetsize} -\func{void}{GetSize}{\param{wxCoord *}{width}, \param{wxCoord *}{height}} +\constfunc{void}{GetSize}{\param{wxCoord *}{width}, \param{wxCoord *}{height}} -For a PostScript device context, this gets the maximum size of graphics -drawn so far on the device context. +\constfunc{wxSize}{GetSize}{\void} -For a Windows printer device context, this gets the horizontal and vertical -resolution. It can be used to scale graphics to fit the page when using -a Windows printer device context. For example, if {\it maxX} and {\it maxY}\rtfsp +This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. +For example, if {\it maxX} and {\it maxY}\rtfsp represent the maximum horizontal and vertical `pixel' values used in your application, the following code will scale the graphic to fit on the printer page: @@ -698,6 +739,13 @@ implements the following methods:\par \end{twocollist} }} +\membersection{wxDC::GetSizeMM}\label{wxdcgetsizemm} + +\constfunc{void}{GetSizeMM}{\param{wxCoord *}{width}, \param{wxCoord *}{height}} + +\constfunc{wxSize}{GetSizeMM}{\void} + +Returns the horizontal and vertical resolution in millimetres. \membersection{wxDC::GetTextBackground}\label{wxdcgettextbackground} @@ -999,12 +1047,10 @@ user scale} (see \helpref{wxDC::SetUserScale}{wxdcsetuserscale}) scales the text Windows, scalable TrueType fonts are always used; in X, results depend on availability of fonts, but usually a reasonable match is found. -Note that the coordinate origin should ideally be selectable, but for -now is always at the top left of the screen/printer. +The coordinate origin is always at the top left of the screen/printer. -Drawing to a Windows printer device context under UNIX -uses the current mapping mode, but mapping mode is currently ignored for -PostScript output. +Drawing to a Windows printer device context uses the current mapping mode, +but mapping mode is currently ignored for PostScript output. The mapping mode can be one of the following: @@ -1025,9 +1071,9 @@ The mapping mode can be one of the following: If {\it optimize} is true (the default), this function sets optimization mode on. This currently means that under X, the device context will not try to set a pen or brush property if it is known to be set already. This approach can fall down -if non-wxWindows code is using the same device context or window, for example +if non-wxWidgets code is using the same device context or window, for example when the window is a panel on which the windowing system draws panel items. -The wxWindows device context 'memory' will now be out of step with reality. +The wxWidgets device context 'memory' will now be out of step with reality. Setting optimization off, drawing, then setting it back on again, is a trick that must occasionally be employed.