.. include:: headings.inc
.. _SVGFileDC:
==========================================================================================================================================
|phoenix_title| **SVGFileDC**
==========================================================================================================================================
A :ref:`SVGFileDC` is a device context onto which graphics and text can be drawn, and the output produced as a vector file, in ``SVG`` format (see the ``W3C`` ``SVG`` Specifications <`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 are given in the ``SVG`` Implementation and Resource Directory <`http://www.svgi.org/ `_>. Vector formats may often be smaller than raster formats.
The intention behind :ref:`SVGFileDC` is that it can be used to produce a file corresponding to the screen display context, :ref:`SVGFileDC`, by passing the :ref:`SVGFileDC` as a parameter instead of a :ref:`SVGFileDC`. Thus the :ref:`SVGFileDC` is a write-only class.
As the :ref:`SVGFileDC` is a vector format, raster operations like :meth:`~SVGFileDC.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 :ref:`SVGFileDC` are supported.
A more substantial ``SVG`` library (for reading and writing) is available at the Art2D website <`http://wxart2d.sourceforge.net/ `_>.
|
|class_hierarchy| Inheritance Diagram
=====================================
Inheritance diagram for class **SVGFileDC**
.. raw:: html
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~SVGFileDC.__init__` Initializes a :ref:`SVGFileDC` with the given `f` filename with the given `Width` and `Height` at `dpi` resolution.
:meth:`~SVGFileDC.Clear` This makes no sense in :ref:`SVGFileDC` and does nothing.
:meth:`~SVGFileDC.CrossHair` Functions not implemented in this DC class.
:meth:`~SVGFileDC.DestroyClippingRegion` Functions not implemented in this DC class.
:meth:`~SVGFileDC.EndDoc` Does nothing.
:meth:`~SVGFileDC.EndPage` Does nothing.
:meth:`~SVGFileDC.FloodFill` Functions not implemented in this DC class.
:meth:`~SVGFileDC.GetClippingBox` Functions not implemented in this DC class.
:meth:`~SVGFileDC.GetPixel` Functions not implemented in this DC class.
:meth:`~SVGFileDC.SetClippingRegion` Functions not implemented in this DC class.
:meth:`~SVGFileDC.SetLogicalFunction` Does the same as :meth:`DC.SetLogicalFunction` , except that only ``COPY`` is available.
:meth:`~SVGFileDC.SetPalette` Functions not implemented in this DC class.
:meth:`~SVGFileDC.StartDoc` Functions not implemented in this DC class.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: SVGFileDC(DC)
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 (see the ``W3C`` ``SVG`` Specifications ).
**Possible constructors**::
SVGFileDC(filename, width=320, height=240, dpi=72)
.. method:: __init__(self, filename, width=320, height=240, dpi=72)
Initializes a :ref:`SVGFileDC` with the given `f` filename with the given `Width` and `Height` at `dpi` resolution.
:param `filename`:
:type `filename`: string
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
:param `dpi`:
:type `dpi`: float
.. method:: Clear(self)
This makes no sense in :ref:`SVGFileDC` and does nothing.
.. method:: CrossHair(self, x, y)
Functions not implemented in this DC class.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
.. method:: DestroyClippingRegion(self)
Functions not implemented in this DC class.
.. method:: EndDoc(self)
Does nothing.
.. method:: EndPage(self)
Does nothing.
.. method:: FloodFill(self, x, y, colour, style=FLOOD_SURFACE)
Functions not implemented in this DC class.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `colour`:
:type `colour`: Colour
:param `style`:
:type `style`: FloodFillStyle
:rtype: `bool`
.. method:: GetClippingBox(self, x, y, width, height)
Functions not implemented in this DC class.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
.. method:: GetPixel(self, x, y, colour)
Functions not implemented in this DC class.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `colour`:
:type `colour`: Colour
:rtype: `bool`
.. method:: SetClippingRegion(self, *args, **kw)
Functions not implemented in this DC class.
|overload| **Overloaded Implementations**:
**~~~**
**SetClippingRegion** `(self, x, y, width, height)`
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
**~~~**
**SetClippingRegion** `(self, pt, sz)`
:param `pt`:
:type `pt`: Point
:param `sz`:
:type `sz`: Size
**~~~**
**SetClippingRegion** `(self, rect)`
:param `rect`:
:type `rect`: Rect
**~~~**
**SetClippingRegion** `(self, region)`
:param `region`:
:type `region`: Region
**~~~**
.. method:: SetLogicalFunction(self, function)
Does the same as :meth:`DC.SetLogicalFunction` , except that only ``COPY`` is available.
Trying to set one of the other values will fail.
:param `function`:
:type `function`: RasterOperationMode
.. method:: SetPalette(self, palette)
Functions not implemented in this DC class.
:param `palette`:
:type `palette`: Palette
.. method:: StartDoc(self, message)
Functions not implemented in this DC class.
:param `message`:
:type `message`: string
:rtype: `bool`