Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices. More...
Public Member Functions | |
QSvgRenderer (QObject parent=null) | |
| |
QSvgRenderer (QByteArray contents, QObject parent=null) | |
| |
QSvgRenderer (QXmlStreamReader contents, QObject parent=null) | |
| |
QSvgRenderer (string filename, QObject parent=null) | |
| |
override void | CreateProxy () |
new bool | Animated () |
| |
new int | AnimationDuration () |
new QRectF | BoundsOnElement (string id) |
| |
new QSize | DefaultSize () |
| |
new bool | ElementExists (string id) |
| |
new bool | IsValid () |
| |
new bool | Load (QByteArray contents) |
| |
new bool | Load (QXmlStreamReader contents) |
| |
new bool | Load (string filename) |
| |
new QMatrix | MatrixForElement (string id) |
| |
new void | Render (QPainter p) |
| |
new void | Render (QPainter p, QRectF bounds) |
| |
new void | Render (QPainter p, string elementId) |
| |
new void | Render (QPainter p, string elementId, QRectF bounds) |
| |
new void | SetViewBox (QRect viewbox) |
new QRect | viewBox () |
new void | Dispose () |
Public Member Functions inherited from QtCore.QObject | |
QObject (QObject parent=null) | |
| |
new bool | BlockSignals (bool b) |
| |
new System.Collections.Generic.List < QObject > | Children () |
| |
new bool | Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
new void | DeleteLater () |
| |
new bool | Disconnect (QObject receiver, string member=null) |
| |
new bool | Disconnect (string signal=null, QObject receiver=null, string member=null) |
| |
new void | DumpObjectInfo () |
| |
new void | DumpObjectTree () |
| |
new System.Collections.Generic.List < QByteArray > | DynamicPropertyNames () |
| |
virtual bool | OnEvent (QEvent arg1) |
| |
virtual bool | EventFilter (QObject arg1, QEvent arg2) |
| |
new bool | Inherits (string classname) |
| |
new void | InstallEventFilter (QObject arg1) |
| |
new bool | IsWidgetType () |
| |
new void | KillTimer (int id) |
| |
new object | Property (string name) |
| |
new void | RemoveEventFilter (QObject arg1) |
| |
new bool | SetProperty (string name, object value) |
| |
new void | SetUserData (uint id, QObjectUserData data) |
new bool | SignalsBlocked () |
| |
new int | StartTimer (int interval) |
| |
new QObjectUserData | UserData (uint id) |
new void | Dispose () |
Public Member Functions inherited from QtCore.Qt | |
delegate QTextStream | FuncQTextStreamQTextStream (QTextStream qTextStream) |
delegate string | FuncStringQByteArray (QByteArray qByteArray) |
delegate QByteArray | FuncQByteArrayString (string @string) |
delegate void | ActionQtMsgTypeString (QtMsgType qtMsgType, string @string) |
delegate QObject | FuncQObject () |
Static Public Member Functions | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
Static Public Member Functions inherited from QtCore.QObject | |
static bool | Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
static bool | Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection) |
| |
static bool | Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member) |
| |
static bool | Disconnect (QObject sender, string signal, QObject receiver, string member) |
| |
static uint | RegisterUserData () |
static string | Tr (string s, string c=null) |
| |
static string | Tr (string s, string c, int n) |
| |
static string | TrUtf8 (string s, string c=null) |
| |
static string | TrUtf8 (string s, string c, int n) |
| |
Static Public Member Functions inherited from QtCore.Qt | |
static QDataStream | Write (QDataStream s, object p) |
static QDataStream | Write (QDataStream arg1, QSizeF arg2) |
static QTextStream | Write (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Write (QDataStream arg1, QPoint arg2) |
static QDataStream | Write (QDataStream arg1, QLineF arg2) |
static QDataStream | Write (QDataStream arg1, QPointF arg2) |
static QDataStream | Write (QDataStream arg1, QChar arg2) |
static QDataStream | Write (QDataStream arg1, QByteArray arg2) |
static QDataStream | Write (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Write (QDataStream arg1, QRectF arg2) |
static QDataStream | Write (QDataStream arg1, QDateTime arg2) |
static QDataStream | Write (QDataStream arg1, QUrl arg2) |
static QDataStream | Write (QDataStream arg1, QTime arg2) |
static QDataStream | Write (QDataStream arg1, QLocale arg2) |
static QDataStream | Write (QDataStream arg1, QBitArray arg2) |
static QDataStream | Write (QDataStream arg1, QUuid arg2) |
static QDataStream | Write (QDataStream arg1, QLine arg2) |
static QDataStream | Write (QDataStream arg1, QDate arg2) |
static QDataStream | Write (QDataStream @out, QRegExp regExp) |
static QDataStream | Write (QDataStream arg1, QRect arg2) |
static QDataStream | Write (QDataStream arg1, QSize arg2) |
static QDataStream | Write (QDataStream s, QVariant.Type p) |
static QDataStream | Write (QDataStream arg1, string arg2) |
static QDataStream | Write (QDataStream @out, System.Collections.Generic.List< string > list) |
static QDataStream | Read (QDataStream arg1, QChar arg2) |
static QDataStream | Read (QDataStream arg1, QLocale arg2) |
static QDataStream | Read (QDataStream arg1, QRect arg2) |
static QDataStream | Read (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Read (QDataStream arg1, QDate arg2) |
static QDataStream | Read (QDataStream arg1, QUrl arg2) |
static QDataStream | Read (QDataStream arg1, QUuid arg2) |
static QTextStream | Read (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Read (QDataStream arg1, QLineF arg2) |
static QDataStream | Read (QDataStream arg1, QRectF arg2) |
static QDataStream | Read (QDataStream arg1, QPointF arg2) |
static QDataStream | Read (QDataStream arg1, QLine arg2) |
static QDataStream | Read (QDataStream arg1, QBitArray arg2) |
static QDataStream | Read (QDataStream arg1, QSize arg2) |
static QDataStream | Read (QDataStream arg1, QDateTime arg2) |
static QDataStream | Read (QDataStream arg1, QTime arg2) |
static QDataStream | Read (QDataStream arg1, QPoint arg2) |
static QDataStream | Read (QDataStream @in, QRegExp regExp) |
static QDataStream | Read (QDataStream s, object p) |
static QDataStream | Read (QDataStream arg1, QByteArray arg2) |
static QDataStream | Read (QDataStream arg1, QSizeF arg2) |
static QDataStream | Read (QDataStream arg1, string arg2) |
static QDataStream | Read (QDataStream s, QVariant.Type p) |
static QDataStream | Read (QDataStream @in, System.Collections.Generic.List< string > list) |
static double | qAcos (double v) |
static void | qAddPostRoutine (System.Action arg1) |
static string | qAppName () |
static double | qAsin (double v) |
static double | qAtan (double v) |
static double | qAtan2 (double x, double y) |
static void | qBadAlloc () |
static int | qCeil (double v) |
static ushort | qChecksum (string s, uint len) |
static QByteArray | qCompress (QByteArray data) |
static QByteArray | qCompress (QByteArray data, int compressionLevel=-1) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1) |
static double | qCos (double v) |
static double | qExp (double v) |
static double | qFabs (double v) |
static double | qFastCos (double x) |
static double | qFastSin (double x) |
static string | qFlagLocation (string method) |
static int | qFloor (double v) |
static bool | qFuzzyCompare (double p1, double p2) |
static bool | qFuzzyCompare (float p1, float p2) |
static bool | qFuzzyIsNull (double d) |
static bool | qFuzzyIsNull (float f) |
static uint | qHash (QBitArray key) |
static uint | qHash (QChar key) |
static uint | qHash (QStringRef key) |
static uint | qHash (QUrl url) |
static uint | qHash (QPersistentModelIndex index) |
static uint | qHash (QByteArray key) |
static uint | qHash (QModelIndex index) |
static uint | qHash (uint key) |
static uint | qHash (sbyte key) |
static uint | qHash (byte key) |
static uint | qHash (short key) |
static uint | qHash (NativeLong key) |
static uint | qHash (ushort key) |
static uint | qHash (long key) |
static uint | qHash (ulong key) |
static uint | qHash (int key) |
static uint | qHash (string key) |
static uint | qHash (NativeULong key) |
static double | qInf () |
static Qt.ActionQtMsgTypeString | qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1) |
static int | qIntCast (float f) |
static int | qIntCast (double f) |
static bool | qIsFinite (double d) |
static bool | qIsFinite (float f) |
static bool | qIsInf (float f) |
static bool | qIsInf (double d) |
static bool | qIsNaN (float f) |
static bool | qIsNaN (double d) |
static bool | qIsNull (float f) |
static bool | qIsNull (double d) |
static double | qLn (double v) |
static double | qPow (double x, double y) |
static double | qQNaN () |
static void | qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function) |
static void | qRemovePostRoutine (System.Action arg1) |
static int | qRound (double d) |
static long | qRound64 (double d) |
static double | qSNaN () |
static bool | qSharedBuild () |
static double | qSin (double v) |
static double | qSqrt (double v) |
static bool | qStringComparisonHelper (QStringRef s1, string s2) |
static double | qTan (double v) |
static QByteArray | qUncompress (QByteArray data) |
static QByteArray | qUncompress (Pointer< byte > data, int nbytes) |
static string | qVersion () |
static void | Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size) |
static QByteArray | Qgetenv (string varName) |
static bool | Qputenv (string varName, QByteArray value) |
static int | Qrand () |
static void | Qsrand (uint seed) |
static int | Qstrcmp (QByteArray str1, QByteArray str2) |
static int | Qstrcmp (QByteArray str1, string str2) |
static int | Qstrcmp (string str1, QByteArray str2) |
static int | Qstrcmp (string str1, string str2) |
static Pointer< sbyte > | Qstrcpy (Pointer< sbyte > dst, string src) |
static Pointer< sbyte > | Qstrdup (string arg1) |
static int | Qstricmp (string arg1, string arg2) |
static uint | Qstrlen (string str) |
static int | Qstrncmp (string str1, string str2, uint len) |
static Pointer< sbyte > | Qstrncpy (Pointer< sbyte > dst, string src, uint len) |
static int | Qstrnicmp (string arg1, string arg2, uint len) |
static uint | Qstrnlen (string str, uint maxlen) |
static string | QtTrId (string id, int n=-1) |
Protected Member Functions | |
QSvgRenderer (System.Type dummy) | |
new void | OnRepaintNeeded () |
| |
Protected Member Functions inherited from QtCore.QObject | |
QObject (System.Type dummy) | |
virtual void | OnChildEvent (QChildEvent arg1) |
| |
virtual void | ConnectNotify (string signal) |
| |
virtual void | OnCustomEvent (QEvent arg1) |
| |
new void | OnDestroyed (QObject arg1=null) |
| |
virtual void | DisconnectNotify (string signal) |
| |
new int | Receivers (string signal) |
| |
new QObject | Sender () |
| |
new int | SenderSignalIndex () |
| |
virtual void | OnTimerEvent (QTimerEvent arg1) |
| |
Properties | |
Slot | RepaintNeeded |
| |
new QRectF | ViewBox [get, set] |
| |
new int | FramesPerSecond [get, set] |
| |
new int | CurrentFrame [get, set] |
static new QMetaObject | StaticMetaObject [get] |
new IQSvgRendererSignals | Emit [get] |
Properties inherited from QtCore.QObject | |
virtual EventHandler < QEventArgs< QChildEvent > > | ChildEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | CustomEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | Event |
| |
virtual EventHandler < QEventArgs< QTimerEvent > > | TimerEvent |
| |
Slot< QObject > | DestroyedQObject |
Slot | Destroyed |
| |
new QObject | Parent [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
new string | ObjectName [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
| |
static new QMetaObject | StaticQtMetaObject [get] |
new IQObjectSignals | Emit [get] |
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Using QSvgRenderer, Scalable Vector Graphics (SVG) can be rendered onto any QPaintDevice subclass, including QWidget, QImage, and QGLWidget.
QSvgRenderer provides an API that supports basic features of SVG rendering, such as loading and rendering of static drawings, and more interactive features like animation. Since the rendering is performed using QPainter, SVG drawings can be rendered on any subclass of QPaintDevice.
SVG drawings are either loaded when an QSvgRenderer is constructed, or loaded later using the load() functions. Data is either supplied directly as serialized XML, or indirectly using a file name. If a valid file has been loaded, either when the renderer is constructed or at some later time, isValid() returns true; otherwise it returns false. QSvgRenderer provides the render() slot to render the current document, or the current frame of an animated document, using a given painter.
The defaultSize() function provides information about the amount of space that is required to render the currently loaded SVG file. This is useful for paint devices, such as QWidget, that often need to supply a size hint to their parent layout. The default size of a drawing may differ from its visible area, found using the viewBox property.
Animated SVG drawings are supported, and can be controlled with a simple collection of functions and properties:
The animated() function indicates whether a drawing contains animation information.
The framesPerSecond property contains the rate at which the animation plays.
Finally, the QSvgRenderer class provides the repaintNeeded() signal which is emitted whenever the rendering of the document needs to be updated.
See also QSvgWidget, QtSvg Module, SVG Viewer Example, and QPicture.
|
protected |
QtSvg.QSvgRenderer.QSvgRenderer | ( | QObject | parent = null | ) |
Constructs a new renderer with the given parent.
QtSvg.QSvgRenderer.QSvgRenderer | ( | QByteArray | contents, |
QObject | parent = null |
||
) |
Constructs a new renderer with the given parent and loads the SVG data from the byte array specified by contents.
QtSvg.QSvgRenderer.QSvgRenderer | ( | QXmlStreamReader | contents, |
QObject | parent = null |
||
) |
Constructs a new renderer with the given parent and loads the SVG data using the stream reader specified by contents.
This function was introduced in Qt 4.5.
QtSvg.QSvgRenderer.QSvgRenderer | ( | string | filename, |
QObject | parent = null |
||
) |
Constructs a new renderer with the given parent and loads the contents of the SVG file with the specified filename.
new bool QtSvg.QSvgRenderer.Animated | ( | ) |
Returns true if the current document contains animated elements; otherwise returns false.
See also framesPerSecond().
new int QtSvg.QSvgRenderer.AnimationDuration | ( | ) |
new QRectF QtSvg.QSvgRenderer.BoundsOnElement | ( | string | id | ) |
Returns bounding rectangle of the item with the given id. The transformation matrix of parent elements is not affecting the bounds of the element.
This function was introduced in Qt 4.2.
See also matrixForElement().
|
virtual |
Reimplemented from QtCore.QObject.
new QSize QtSvg.QSvgRenderer.DefaultSize | ( | ) |
Returns the default size of the document contents.
new void QtSvg.QSvgRenderer.Dispose | ( | ) |
new bool QtSvg.QSvgRenderer.ElementExists | ( | string | id | ) |
Returns true if the element with the given id exists in the currently parsed SVG file and is a renderable element.
Note: this method returns true only for elements that can be rendered. Which implies that elements that are considered part of the fill/stroke style properties, e.g. radialGradients even tough marked with "id" attributes will not be found by this method.
This function was introduced in Qt 4.2.
new bool QtSvg.QSvgRenderer.IsValid | ( | ) |
Returns true if there is a valid current document; otherwise returns false.
new bool QtSvg.QSvgRenderer.Load | ( | QByteArray | contents | ) |
Loads the specified SVG format contents, returning true if the content was successfully parsed; otherwise returns false.
new bool QtSvg.QSvgRenderer.Load | ( | QXmlStreamReader | contents | ) |
Loads the specified SVG in contents, returning true if the content was successfully parsed; otherwise returns false.
The reader will be used from where it currently is positioned. If contents is null, behavior is undefined.
This function was introduced in Qt 4.5.
new bool QtSvg.QSvgRenderer.Load | ( | string | filename | ) |
Loads the SVG file specified by filename, returning true if the content was successfully parsed; otherwise returns false.
new QMatrix QtSvg.QSvgRenderer.MatrixForElement | ( | string | id | ) |
Returns the transformation matrix for the element with the given id. The matrix is a product of the transformation of the element's parents. The transformation of the element itself is not included.
To find the bounding rectangle of the element in logical coordinates, you can apply the matrix on the rectangle returned from boundsOnElement().
This function was introduced in Qt 4.2.
See also boundsOnElement().
|
protected |
This signal is emitted whenever the rendering of the document needs to be updated, usually for the purposes of animation.
new void QtSvg.QSvgRenderer.Render | ( | QPainter | p | ) |
Renders the current document, or the current frame of an animated document, using the given painter.
Renders the current document, or the current frame of an animated document, using the given painter on the specified bounds within the painter. If the bounding rectangle is not specified the SVG file is mapped to the whole paint device.
new void QtSvg.QSvgRenderer.Render | ( | QPainter | p, |
string | elementId | ||
) |
Renders the current document, or the current frame of an animated document, using the given painter.
Renders the current document, or the current frame of an animated document, using the given painter.
new void QtSvg.QSvgRenderer.SetViewBox | ( | QRect | viewbox | ) |
|
static |
|
static |
|
static |
|
static |
new QRect QtSvg.QSvgRenderer.viewBox | ( | ) |
|
getset |
|
getprotected |
|
getset |
This property holds the number of frames per second to be shown.
The number of frames per second is 0 if the current document is not animated.
|
addremove |
This signal is emitted whenever the rendering of the document needs to be updated, usually for the purposes of animation.
|
staticget |
|
getset |
This property holds the rectangle specifying the visible area of the document in logical coordinates.
This property was introduced in Qt 4.2.