Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QSvgGenerator class provides a paint device that is used to create SVG drawings. More...
Public Member Functions | |
QSvgGenerator () | |
| |
override void | CreateProxy () |
override QPaintEngine | PaintEngine () |
| |
new void | Dispose () |
Public Member Functions inherited from QtGui.QPaintDevice | |
new int | ColorCount () |
| |
new int | Depth () |
| |
virtual int | DevType () |
virtual System.IntPtr | GetDC () |
new int | Height () |
| |
new int | HeightMM () |
| |
new int | LogicalDpiX () |
| |
new int | LogicalDpiY () |
| |
new int | NumColors () |
| |
new bool | PaintingActive () |
| |
new int | PhysicalDpiX () |
| |
new int | PhysicalDpiY () |
| |
virtual void | ReleaseDC (System.IntPtr hdc) |
new int | Width () |
| |
new int | WidthMM () |
| |
new void | Dispose () |
Public Member Functions inherited from QtGui.IQPaintDevice | |
new int | ColorCount () |
new int | Depth () |
int | DevType () |
System.IntPtr | GetDC () |
new int | Height () |
new int | HeightMM () |
new int | LogicalDpiX () |
new int | LogicalDpiY () |
new int | NumColors () |
QPaintEngine | PaintEngine () |
new bool | PaintingActive () |
new int | PhysicalDpiX () |
new int | PhysicalDpiY () |
void | ReleaseDC (System.IntPtr hdc) |
new int | Width () |
new int | WidthMM () |
Protected Member Functions | |
QSvgGenerator (System.Type dummy) | |
override int | Metric (QPaintDevice.PaintDeviceMetric metric) |
| |
Protected Member Functions inherited from QtGui.QPaintDevice | |
QPaintDevice (System.Type dummy) | |
QPaintDevice () | |
| |
Properties | |
new QRect | ViewBox [get, set] |
| |
Properties inherited from QtGui.QPaintDevice | |
virtual System.IntPtr | SmokeObject [get, set] |
new ushort | Painters [get, set] |
Additional Inherited Members | |
Public Types inherited from QtGui.QPaintDevice | |
enum | PaintDeviceMetric { PdmDepth = 6, PdmDpiX = 7, PdmDpiY = 8, PdmHeight = 2, PdmHeightMM = 4, PdmNumColors = 5, PdmPhysicalDpiX = 9, PdmPhysicalDpiY = 10, PdmWidth = 1, PdmWidthMM = 3 } |
More... | |
Protected Attributes inherited from QtGui.QPaintDevice | |
SmokeInvocation | interceptor |
The QSvgGenerator class provides a paint device that is used to create SVG drawings.
This paint device represents a Scalable Vector Graphics (SVG) drawing. Like QPrinter, it is designed as a write-only device that generates output in a specific format.
To write an SVG file, you first need to configure the output by setting the fileName or outputDevice properties. It is usually necessary to specify the size of the drawing by setting the size property, and in some cases where the drawing will be included in another, the viewBox property also needs to be set.
QSvgGenerator generator;
generator.setFileName(path);
generator.setSize(QSize(200, 200));
generator.setViewBox(QRect(0, 0, 200, 200));
generator.setTitle(tr("SVG Generator Example Drawing"));
generator.setDescription(tr("An SVG drawing created by the SVG Generator "
"Example provided with Qt."));
Other meta-data can be specified by setting the title, description and resolution properties.
As with other QPaintDevice subclasses, a QPainter object is used to paint onto an instance of this class:
QPainter painter;
painter.begin(&generator);
...
painter.end();
Painting is performed in the same way as for any other paint device. However, it is necessary to use the QPainter::begin() and end() to explicitly begin and end painting on the device.
The SVG Generator Example shows how the same painting commands can be used for painting a widget and writing an SVG file.
See also QSvgRenderer, QSvgWidget, and About SVG.
|
protected |
QtSvg.QSvgGenerator.QSvgGenerator | ( | ) |
Constructs a new generator.
|
virtual |
Reimplemented from QtGui.QPaintDevice.
new void QtSvg.QSvgGenerator.Dispose | ( | ) |
|
protectedvirtual |
Reimplemented from QPaintDevice::metric().
Reimplemented from QtGui.QPaintDevice.
|
virtual |
Reimplemented from QPaintDevice::paintEngine().
Returns the paint engine used to render graphics to be converted to SVG format information.
Implements QtGui.QPaintDevice.
|
getset |
Returns viewBoxF().toRect().
This function was introduced in Qt 4.5.