A wx.SVGFileDC is a device context onto which graphics and text can be drawn, and the output produced as a vector file, in SVG
format.
This format can be read by a range of programs, including a Netscape plugin (Adobe) and the open source Inkscape program (http://inkscape.org/). Full details are given in the W3C
SVG
recommendation (http://www.w3.org/TR/SVG/).
The intention behind wx.SVGFileDC is that it can be used to produce a file corresponding to the screen display context, wx.SVGFileDC, by passing the wx.SVGFileDC as a parameter instead of a wx.DC. Thus the wx.SVGFileDC is a write-only class.
As the wx.SVGFileDC 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 in wx.SVGFileDC are supported.
A more substantial SVG
library (for reading and writing) is available at the Art2D website http://wxart2d.sourceforge.net/.
__init__ |
Initializes a wx.SVGFileDC with the given f filename with the given Width and Height at dpi resolution. |
Clear |
This makes no sense in wx.SVGFileDC and does nothing. |
CrossHair |
Functions not implemented in this DC class. |
DestroyClippingRegion |
Destroys the current clipping region so that none of the DC is clipped. |
EndDoc |
Does nothing. |
EndPage |
Does nothing. |
FloodFill |
Functions not implemented in this DC class. |
GetClippingBox |
Functions not implemented in this DC class. |
GetPixel |
Functions not implemented in this DC class. |
SetClippingRegion |
Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. |
SetLogicalFunction |
Does the same as wx.DC.SetLogicalFunction , except that only wx.COPY is available. |
SetPalette |
Functions not implemented in this DC class. |
StartDoc |
Functions not implemented in this DC class. |
wx.
SVGFileDC
(DC)¶Possible constructors:
SVGFileDC(filename, width=320, height=240, dpi=72)
A SVGFileDC is a device context onto which graphics and text can be
drawn, and the output produced as a vector file, in SVG
format.
__init__
(self, filename, width=320, height=240, dpi=72)¶Initializes a wx.SVGFileDC with the given f filename with the given Width and Height at dpi resolution.
Parameters: |
|
---|
Clear
(self)¶This makes no sense in wx.SVGFileDC and does nothing.
CrossHair
(self, x, y)¶Functions not implemented in this DC class.
Parameters: |
|
---|
DestroyClippingRegion
(self)¶Destroys the current clipping region so that none of the DC is clipped.
Since intersections arising from sequential calls to SetClippingRegion are represented with nested SVG
group elements (<g>), all such groups are closed when DestroyClippingRegion is called.
EndDoc
(self)¶Does nothing.
EndPage
(self)¶Does nothing.
FloodFill
(self, x, y, colour, style=FLOOD_SURFACE)¶Functions not implemented in this DC class.
Parameters: |
|
---|---|
Return type: | bool |
GetClippingBox
(self, x, y, width, height)¶Functions not implemented in this DC class.
Parameters: |
|
---|
GetPixel
(self, x, y, colour)¶Functions not implemented in this DC class.
Parameters: |
|
---|---|
Return type: | bool |
SetClippingRegion
(self, *args, **kw)¶SetClippingRegion (self, x, y, width, height)
Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region.
Clipping is implemented in the SVG
output using SVG
group elements (<g>), with nested group elements being used to represent clipping region intersections when two or more calls are made to SetClippingRegion
.
Parameters: |
|
---|
SetClippingRegion (self, pt, sz)
This is an overloaded member function, provided for convenience.
It differs from the above function only in what argument(s) it accepts.
Parameters: |
---|
SetClippingRegion (self, rect)
This is an overloaded member function, provided for convenience.
It differs from the above function only in what argument(s) it accepts.
Parameters: | rect (wx.Rect) – |
---|
SetClippingRegion (self, region)
This function is not implemented in this DC class.
It could be implemented in future if a GetPoints() function were made available on wx.Region.
Parameters: | region (wx.Region) – |
---|
SetLogicalFunction
(self, function)¶Does the same as wx.DC.SetLogicalFunction
, except that only wx.COPY
is available.
Trying to set one of the other values will fail.
Parameters: | function (RasterOperationMode) – |
---|
SetPalette
(self, palette)¶Functions not implemented in this DC class.
Parameters: | palette (wx.Palette) – |
---|
StartDoc
(self, message)¶Functions not implemented in this DC class.
Parameters: | message (string) – |
---|---|
Return type: | bool |