GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing docs.wxpython.org — wx.SVGFileDC — wxPython 4.3.2 Docs
|
Initializes a wx.SVGFileDC with the given filename, width and height at dpi resolution, and an optional title. |
|
Opens an accessible group wrapping all subsequent drawing until the matching |
|
Opens a new layer with the given opacity. |
|
Draws a rectangle the size of the |
|
Function not implemented in this DC class. |
|
Destroys the current clipping region so that none of the DC is clipped. |
|
Closes the accessible group opened by the most recent |
|
Function not implemented in this DC class. |
|
Closes the layer opened by the most recent |
|
Function not implemented in this DC class. |
|
Function not implemented in this DC class. |
|
Function not implemented in this DC class. |
|
Returns the graphics context associated with this DC. |
|
Function not implemented in this DC class. |
|
Function not implemented in this DC class. |
|
Returns the |
|
Saves the |
|
Replaces the default bitmap handler with handler. |
|
Function not implemented in this DC class. |
|
Function not implemented in this DC class. |
|
Set the shape rendering mode of the generated |
|
Function not implemented in this DC class. |
|
Function not implemented in this DC class. |
Properties Summary¶See |
|
See |
|
See |
Class API¶Possible constructors:
SVGFileDC(filename, width=320, height=240, dpi=SVG_DEFAULT_DPI, title="") -> None SVGFileDC(size, filename="", title="", dpi=SVG_DEFAULT_DPI) -> None
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=SVG_DEFAULT_DPI, title=””)
Initializes a wx.SVGFileDC with the given filename, width and height at dpi resolution, and an optional title.
The title provides a readable name for the SVG document. The filename is allowed to be empty, in which case no SVG file will be written. Call GetSVGDocument to retrieve the generated content.
filename (string)
width (int)
height (int)
dpi (float)
title (string)
None
__init__ (self, size, filename=””, title=””, dpi=SVG_DEFAULT_DPI)
Initializes a wx.SVGFileDC with the given size, an optional filename, an optional title, and an optional dpi resolution.
The title provides a readable name for the SVG document. The filename is allowed to be empty, in which case no SVG file will be written. Call GetSVGDocument to retrieve the generated content.
size (wx.Size)
filename (string)
title (string)
dpi (float)
None
Added in version 4.3/wxWidgets-3.3.2.
Opens an accessible group wrapping all subsequent drawing until the matching EndAccessibleGroup call.
The group is emitted as an SVG <g> element carrying the given attributes, optionally followed by <title> and <desc> children supplying an accessible name and long description.
Prefer SVGAccessibleGroup for RAII-style scoping, which guarantees EndAccessibleGroup is called on scope exit.
attributes (wx.SVGAttributes)
title (string)
desc (string)
None
Added in version 4.3/wxWidgets-3.3.3.
Opens a new layer with the given opacity.
All drawing commands until the matching EndLayer call will be composited with this opacity. Layers can be nested.
opacity (float)
None
Added in version 4.3/wxWidgets-3.3.3.
Draws a rectangle the size of the SVG using the wx.DC.SetBackground brush.
None
Function not implemented in this DC class.
x (int)
y (int)
None
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.
None
Closes the accessible group opened by the most recent BeginAccessibleGroup call.
None
Added in version 4.3/wxWidgets-3.3.3.
Function not implemented in this DC class.
None
Closes the layer opened by the most recent BeginLayer call.
None
Added in version 4.3/wxWidgets-3.3.3.
Function not implemented in this DC class.
None
Function not implemented in this DC class.
x (int)
y (int)
colour (wx.Colour)
style (FloodFillStyle)
bool
Function not implemented in this DC class.
int
Returns the graphics context associated with this DC.
The returned object is a SVGGraphicsContext instance. While wx.SVGFileDC provides standard wx.DC drawing methods, retrieving the wx.GraphicsContext allows using more advanced drawing features that are not available in the base wx.DC API, such as:
Complex paths including cubic and quadratic Bézier curves.
Linear and radial gradient brushes.
Transparency and alpha blending for all drawing operations.
Advanced coordinate transformations (scaling, rotation, skewing) applied to groups of objects.
Note that any state changes (pen, brush, font) made to the returned context are mirrored back to the DC, and vice versa.
Added in version 4.3/wxWidgets-3.3.3.
Function not implemented in this DC class.
Function not implemented in this DC class.
x (int)
y (int)
colour (wx.Colour)
bool
Returns the SVG document as a string.
This can be used to retrieve the generated SVG content regardless of whether it was also written to a file. This can be called after all drawing commands to get the current SVG content.
str
Added in version 4.3/wxWidgets-3.3.3.
Saves the SVG document to the file specified in the constructor.
This is called automatically by the destructor if a filename was provided, but calling it explicitly allows checking for errors. Does nothing if no filename was provided or if the file has already been saved.
bool
True if the file was written successfully, False otherwise.
Added in version 4.3/wxWidgets-3.3.3.
Replaces the default bitmap handler with handler.
By default, an object of wx.SVGBitmapFileHandler class is used as bitmap handler. You may want to replace it with an object of predefined wx.SVGBitmapEmbedHandler class to embed the bitmaps in the generated SVG instead of storing them in separate files like this:
mySVGFileDC.SetBitmapHandler(wx.SVGBitmapEmbedHandler())
or derive your own bitmap handler class and use it if you need to customize the bitmap handling further.
handler (wx.SVGBitmapHandler) – The new bitmap handler. If non-null, this object takes ownership of this handler and will delete it when it is not needed any more.
None
Added in version 4.1/wxWidgets-3.1.0.
Function not implemented in this DC class.
function (RasterOperationMode)
None
Function not implemented in this DC class.
palette (wx.Palette)
None
Set the shape rendering mode of the generated SVG.
All subsequent drawing calls will have this rendering mode set in the SVG file.
The default mode is wx.SVG_SHAPE_RENDERING_AUTO.
renderingMode (SVGShapeRenderingMode)
None
Added in version 4.1/wxWidgets-3.1.3.
Function not implemented in this DC class.
message (string)
bool
Function not implemented in this DC class.
None
See GetLogicalFunction and SetLogicalFunction
See GetSVGDocument