📄 dcsvg.tex
字号:
\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}%%\input{psbox.tex}\newcommand{\commandref}[2]{\helpref{{\tt $\backslash$#1}}{#2}}%\newcommand{\commandrefn}[2]{\helprefn{{\tt $\backslash$#1}}{#2}\index{#1}}%\newcommand{\commandpageref}[2]{\latexignore{\helprefn{{\tt $\backslash$#1}}{#2}}\latexonly{{\tt $\backslash$#1} {\it page \pageref{#2}}}\index{#1}}%\newcommand{\indexit}[1]{#1\index{#1}}%\newcommand{\inioption}[1]{{\bf {\tt #1}}\index{#1}}%\parskip=10pt%\parindent=0pt%%\backgroundcolour{255;255;255}\textcolour{0;0;0}% Has an effect in HTML only\winhelpignore{\title{Manual for wxSVGFileDC}%\author{Chris Elliott}%\date{June 2002}%}%\winhelponly{\title{Manual for wxSVGFileDC}%\author{by Chris Elliott}%}%\makeindex%\begin{document}%\maketitle%\pagestyle{fancyplain}%\bibliographystyle{plain}%\pagenumbering{roman}%\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}%\setfooter{\thepage}{}{}{}{}{\thepage}%\tableofcontents%\chapter*{Copyright notice}%\setheader{{\it COPYRIGHT}}{}{}{}{}{{\it COPYRIGHT}}%\setfooter{\thepage}{}{}{}{}{\thepage}%\chapter*{wxSVGFileDC}%\setheader{{\it wxSVGFileDC}}{}{}{}{}{{\it wxSVGFileDC}}%\setfooter{\thepage}{}{}{}{}{\thepage}%\section{\class{wxSVGFileDC}}\label{wxSVGFileDC}A wxSVGFileDC is a {\it device context} onto which graphics and text can be drawn, and the outputproduced as a vector file, in the SVG format (see http://www.w3.org/TR/2001/REC-SVG-20010904/ ).This format can be read by a range of programs, including a Netscape plugin (Adobe), full details at http://www.w3.org/Graphics/SVG/SVG-Implementations.htm8 Vector formats may often be smaller than raster formats.The intention behind wxSVGFileDC is that it can be used to produce a file corresponding to the screen display context, wxSVGFileDC, by passing the wxSVGFileDC as a parameter instead of a wxSVGFileDC. Thusthe wxSVGFileDC is a write-only class.As the wxSVGFileDC is a vector format, raster operations like GetPixel are unlikely to be supported.However, the SVG specification allows for PNG format raster files to be embedded in the SVG, and so bitmaps, icons and blit operations into the wxSVGFileDC are supported.A more substantial SVG library (for reading and writing) is available at http://www.xs4all.nl/~kholwerd/wxstuff/canvas/htmldocbook/aap.html\wxheading{Derived from}\helpref{wxDCBase}{wxDCBase}\wxheading{Include files}<wx/dcsvg.h>\wxheading{See also}%\helpref{Overview}{dcoverview}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxSVGFileDC::wxSVGFileDC}\func{}{wxSVGFileDC}{\param{wxString}{ f}} \rtfsp\func{}{wxSVGFileDC}{\param{wxString}{ f}, \param{int}{ Width},\param{int}{ Height}} \rtfsp\func{}{wxSVGFileDC}{\param{wxString}{ f}, \param{int}{ Width},\param{int}{ Height},\param{float}{ dpi}} \rtfspConstructors: a filename {\it f} with default size 340x240 at 72.0 dots per inch (a frequent screen resolution).a filename {\it f} with size {\it Width} by {\it Height} at 72.0 dots per inch a filename {\it f} with size {\it Width} by {\it Height} at {\it dpi} resolution.\membersection{wxSVGFileDC::\destruct{wxSVGFileDC}}\func{}{\destruct{wxSVGFileDC}}{\void}Destructor.\membersection{wxSVGFileDC::BeginDrawing}\label{wxdcbegindrawing}Does nothing\membersection{wxSVGFileDC::Blit}\label{wxdcblit}\func{bool}{Blit}{\param{wxCoord}{ xdest}, \param{wxCoord}{ ydest}, \param{wxCoord}{ width}, \param{wxCoord}{ height}, \param{wxSVGFileDC* }{source}, \param{wxCoord}{ xsrc}, \param{wxCoord}{ ysrc}, \param{int}{ logicalFunc = wxCOPY}, \param{bool }{useMask = FALSE}, \param{wxCoord}{ xsrcMask = -1}, \param{wxCoord}{ ysrcMask = -1}}As wxDC: Copy from a source DC to this DC, specifying the destinationcoordinates, size of area to copy, source DC, source coordinates,logical function, whether to use a bitmap mask, and mask source position.\membersection{wxSVGFileDC::CalcBoundingBox}\label{wxdccalcboundingbox}\func{void}{CalcBoundingBox}{\param{wxCoord }{x}, \param{wxCoord }{y}}Adds the specified point to the bounding box which can be retrieved with \helpref{MinX}{wxdcminx}, \helpref{MaxX}{wxdcmaxx} and \helpref{MinY}{wxdcminy}, \helpref{MaxY}{wxdcmaxy} functions.\membersection{wxSVGFileDC::Clear}\label{wxdcclear}\func{void}{Clear}{\void}This makes no sense in wxSVGFileDC and does nothing\membersection{wxSVGFileDC::CrossHair}\label{wxdccrosshair}\func{void}{CrossHair}{\param{wxCoord}{ x}, \param{wxCoord}{ y}}Not Implemented\membersection{wxSVGFileDC::DestroyClippingRegion}\label{wxdcdestroyclippingregion}\func{void}{DestroyClippingRegion}{\void}Not Implemented\membersection{wxSVGFileDC::DeviceToLogicalX}\label{wxdcdevicetologicalx}\func{wxCoord}{DeviceToLogicalX}{\param{wxCoord}{ x}}Convert device X coordinate to logical coordinate, using the currentmapping mode.\membersection{wxSVGFileDC::DeviceToLogicalXRel}\label{wxdcdevicetologicalxrel}\func{wxCoord}{DeviceToLogicalXRel}{\param{wxCoord}{ x}}Convert device X coordinate to relative logical coordinate, using the currentmapping mode but ignoring the x axis orientation.Use this function for converting a width, for example.\membersection{wxSVGFileDC::DeviceToLogicalY}\label{wxdcdevicetologicaly}\func{wxCoord}{DeviceToLogicalY}{\param{wxCoord}{ y}}Converts device Y coordinate to logical coordinate, using the currentmapping mode.\membersection{wxSVGFileDC::DeviceToLogicalYRel}\label{wxdcdevicetologicalyrel}\func{wxCoord}{DeviceToLogicalYRel}{\param{wxCoord}{ y}}Convert device Y coordinate to relative logical coordinate, using the currentmapping mode but ignoring the y axis orientation.Use this function for converting a height, for example.\membersection{wxSVGFileDC::DrawArc}\label{wxdcdrawarc}\func{void}{DrawArc}{\param{wxCoord}{ x1}, \param{wxCoord}{ y1}, \param{wxCoord}{ x2}, \param{wxCoord}{ y2}, \param{wxCoord}{ xc}, \param{wxCoord}{ yc}}Draws an arc of a circle, centred on ({\it xc, yc}), with starting point ({\it x1, y1})and ending at ({\it x2, y2}). The current pen is used for the outlineand the current brush for filling the shape.The arc is drawn in an anticlockwise direction from the start point to the end point.\membersection{wxSVGFileDC::DrawBitmap}\label{wxdcdrawbitmap}\func{void}{DrawBitmap}{\param{const wxBitmap\&}{ bitmap}, \param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{bool}{ transparent}}Draw a bitmap on the device context at the specified point. If {\it transparent} is true and the bitmap hasa transparency mask, the bitmap will be drawn transparently.When drawing a mono-bitmap, the current text foreground colour will be used to draw the foregroundof the bitmap (all bits set to 1), and the current text background colour to draw the background(all bits set to 0). See also \helpref{SetTextForeground}{wxdcsettextforeground}, \helpref{SetTextBackground}{wxdcsettextbackground} and \helpref{wxMemoryDC}{wxmemorydc}.\membersection{wxSVGFileDC::DrawCheckMark}\label{wxdcdrawcheckmark}\func{void}{DrawCheckMark}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}\func{void}{DrawCheckMark}{\param{const wxRect \&}{rect}}Draws a check mark inside the given rectangle.\membersection{wxSVGFileDC::DrawCircle}\label{wxdcdrawcircle}\func{void}{DrawCircle}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ radius}}\func{void}{DrawCircle}{\param{const wxPoint\&}{ pt}, \param{wxCoord}{ radius}}Draws a circle with the given centre and radius.\wxheading{See also}\helpref{DrawEllipse}{wxdcdrawellipse}\membersection{wxSVGFileDC::DrawEllipse}\label{wxdcdrawellipse}\func{void}{DrawEllipse}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}\func{void}{DrawEllipse}{\param{const wxPoint\&}{ pt}, \param{const wxSize\&}{ size}}\func{void}{DrawEllipse}{\param{const wxRect\&}{ rect}}Draws an ellipse contained in the rectangle specified either with the given topleft corner and the given size or directly. The current pen is used for theoutline and the current brush for filling the shape.\wxheading{See also}\helpref{DrawCircle}{wxdcdrawcircle}\membersection{wxSVGFileDC::DrawEllipticArc}\label{wxdcdrawellipticarc}\func{void}{DrawEllipticArc}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}, \param{double}{ start}, \param{double}{ end}}Draws an arc of an ellipse. The current pen is used for drawing the arc andthe current brush is used for drawing the pie.{\it x} and {\it y} specify the x and y coordinates of the upper-left corner of the rectangle that containsthe ellipse.{\it width} and {\it height} specify the width and height of the rectangle that containsthe ellipse.{\it start} and {\it end} specify the start and end of the arc relative to the three-o'clockposition from the center of the rectangle. Angles are specifiedin degrees (360 is a complete circle). Positive values meancounter-clockwise motion. If {\it start} is equal to {\it end}, acomplete ellipse will be drawn.\membersection{wxSVGFileDC::DrawIcon}\label{wxdcdrawicon}\func{void}{DrawIcon}{\param{const wxIcon\&}{ icon}, \param{wxCoord}{ x}, \param{wxCoord}{ y}}Draw an icon on the display (does nothing if the device context is PostScript).This can be the simplest way of drawing bitmaps on a window.\membersection{wxSVGFileDC::DrawLine}\label{wxdcdrawline}\func{void}{DrawLine}{\param{wxCoord}{ x1}, \param{wxCoord}{ y1}, \param{wxCoord}{ x2}, \param{wxCoord}{ y2}}Draws a line from the first point to the second. The current pen is usedfor drawing the line.\membersection{wxSVGFileDC::DrawLines}\label{wxdcdrawlines}\func{void}{DrawLines}{\param{int}{ n}, \param{wxPoint}{ points[]}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0}}\func{void}{DrawLines}{\param{wxList *}{points}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0}}Draws lines using an array of {\it points} of size {\it n}, or list ofpointers to points, adding the optional offset coordinate. The currentpen is used for drawing the lines. The programmer is responsible fordeleting the list of points.\membersection{wxSVGFileDC::DrawPolygon}\label{wxdcdrawpolygon}\func{void}{DrawPolygon}{\param{int}{ n}, \param{wxPoint}{ points[]}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0},\\ \param{int }{fill\_style = wxODDEVEN\_RULE}}\func{void}{DrawPolygon}{\param{wxList *}{points}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0},\\ \param{int }{fill\_style = wxODDEVEN\_RULE}}Draws a filled polygon using an array of {\it points} of size {\it n},or list of pointers to points, adding the optional offset coordinate.The last argument specifies the fill rule: {\bf wxODDEVEN\_RULE} (thedefault) or {\bf wxWINDING\_RULE}.The current pen is used for drawing the outline, and the current brushfor 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.\membersection{wxSVGFileDC::DrawPoint}\label{wxdcdrawpoint}\func{void}{DrawPoint}{\param{wxCoord}{ x}, \param{wxCoord}{ y}}Draws a point using the current pen.\membersection{wxSVGFileDC::DrawRectangle}\label{wxdcdrawrectangle}\func{void}{DrawRectangle}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}Draws a rectangle with the given top left corner, and with the givensize. The current pen is used for the outline and the current brushfor filling the shape.\membersection{wxSVGFileDC::DrawRotatedText}\label{wxdcdrawrotatedtext}\func{void}{DrawRotatedText}{\param{const wxString\& }{text}, \param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{double}{ angle}}Draws the text rotated by {\it angle} degrees.The wxMSW wxDC and wxSVGFileDC rotate the text around slightly different points, depending on the size of the font\membersection{wxSVGFileDC::DrawRoundedRectangle}\label{wxdcdrawroundedrectangle}\func{void}{DrawRoundedRectangle}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}, \param{double}{ radius = 20}}Draws a rectangle with the given top left corner, and with the givensize. The corners are quarter-circles using the given radius. Thecurrent pen is used for the outline and the current brush for fillingthe shape.If {\it radius} is positive, the value is assumed to be theradius of the rounded corner. If {\it radius} is negative,the absolute value is assumed to be the {\it proportion} of the smallestdimension of the rectangle. This means that the corner can bea sensible size relative to the size of the rectangle, and also avoidsthe strange effects X produces when the corners are too big forthe rectangle.\membersection{wxSVGFileDC::DrawSpline}\label{wxdcdrawspline}\func{void}{DrawSpline}{\param{wxList *}{points}}Draws a spline between all given control points, using the currentpen. Doesn't delete the wxList and contents. The spline is drawnusing a series of lines, using an algorithm taken from the X drawingprogram `XFIG'.\func{void}{DrawSpline}{\param{wxCoord}{ x1}, \param{wxCoord}{ y1}, \param{wxCoord}{ x2}, \param{wxCoord}{ y2}, \param{wxCoord}{ x3}, \param{wxCoord}{ y3}}Draws a three-point spline using the current pen.\membersection{wxSVGFileDC::DrawText}\label{wxdcdrawtext}\func{void}{DrawText}{\param{const wxString\& }{text}, \param{wxCoord}{ x}, \param{wxCoord}{ y}}Draws a text string at the specified point, using the current text font,and the current text foreground and background colours.The coordinates refer to the top-left corner of the rectangle boundingthe string. See \helpref{wxSVGFileDC::GetTextExtent}{wxdcgettextextent} for howto get the dimensions of a text string, which can be used to position thetext more precisely.\membersection{wxSVGFileDC::EndDoc}\label{wxdcenddoc}\func{void}{EndDoc}{\void}Does nothing\membersection{wxSVGFileDC::EndDrawing}\label{wxdcenddrawing}\func{void}{EndDrawing}{\void}Does nothing\membersection{wxSVGFileDC::EndPage}\label{wxdcendpage}\func{void}{EndPage}{\void}Does nothing\membersection{wxSVGFileDC::FloodFill}\label{wxdcfloodfill}\func{void}{FloodFill}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{const wxColour\&}{ colour}, \param{int}{ style=wxFLOOD\_SURFACE}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -