Core 1.0
Draw Class Reference

Functions for drawing a graphics scene into a vector or a raster image. More...

#include <draw.h>

Static Public Member Functions

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.

Detailed Description

Functions for drawing a graphics scene into a vector or a raster image.

Member Function Documentation

◆ 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
sceneThe scene.
nameName of the file, the format of the image is deduced from the extension.
widthWidth in pixels of the largest side of the image, the other side being computed to preserve the aspect ratio.
rectArea 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
sceneThe scene.
widthWidth in pixels of the largest side of the image, the other side being computed to preserve the aspect ratio.
rectArea 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
sceneThe scene.
nameName of the file.

The image is rendered on an A4 page, in high resolution, with the whole scene.