Functions for drawing a graphics scene into a vector or a raster image.
More...
#include <draw.h>
|
| static void | CreateVector (QGraphicsScene &, const QString &) |
| | Draws the graphics scene as a vector image.
|
| static void | CreateImage (QGraphicsScene &, const QString &, int, const QRectF &s=QRectF()) |
| | Draws the graphics scene as an image and saves it in a file.
|
| static QImage | CreateImage (QGraphicsScene &, int, const QRectF &s=QRectF()) |
| | Draws the graphics scene as an image, with a transparent background.
|
Functions for drawing a graphics scene into a vector or a raster image.
◆ CreateImage() [1/2]
| void Draw::CreateImage |
( |
QGraphicsScene & | scene, |
|
|
const QString & | name, |
|
|
int | width, |
|
|
const QRectF & | rect = QRectF() ) |
|
static |
Draws the graphics scene as an image and saves it in a file.
- Parameters
-
| scene | The scene. |
| name | Name of the file, the format of the image is deduced from the extension. |
| width | Width in pixels of the largest side of the image, the other side being computed to preserve the aspect ratio. |
| rect | Area of the scene to draw, the whole scene rectangle if the rectangle is null. |
◆ CreateImage() [2/2]
| QImage Draw::CreateImage |
( |
QGraphicsScene & | scene, |
|
|
int | width, |
|
|
const QRectF & | rect = QRectF() ) |
|
static |
Draws the graphics scene as an image, with a transparent background.
- Parameters
-
| scene | The scene. |
| width | Width in pixels of the largest side of the image, the other side being computed to preserve the aspect ratio. |
| rect | Area of the scene to draw, the whole scene rectangle if the rectangle is null. |
- Returns
- The image.
◆ CreateVector()
| void Draw::CreateVector |
( |
QGraphicsScene & | scene, |
|
|
const QString & | name ) |
|
static |
Draws the graphics scene as a vector image.
- Parameters
-
| scene | The scene. |
| name | Name of the file. |
The image is rendered on an A4 page, in high resolution, with the whole scene.