|
|
The Enhanced MetaFile format (EMF) is the native vector graphics file
format on Windows. Qt is a cross-platform application development framework,
widely used for the development of GUI programs. Although it provides tools for almost every aspect of software development,
Qt doesn't include a straightforward solution for the export of 2D graphics to the EMF format. EmfEngine covers this lack and
enables Qt based applications to easily export graphics created using the
QPainter class to the Enhanced Metafile format.
It is built on top of the QPaintEngine class,
which provides an abstract definition of how QPainter draws to a given device on a given platform.
EmfEngine was written as an add-on to QtiPlot, in order to enable the export of 2D plots to the EMF file format.
All drawing capabilities of the QPainter class used in QtiPlot are supported by EmfEngine.
Using EmfEngine is straightforward, as you may see from the code example bellow:
void MyClass::exportEMF(const QString& fileName)
{
EmfPaintDevice emf(QSize(500, 400), fileName);
QPainter paint.begin(&emf);
// ... perform your painting operations here ...
paint.end();
}
The target distribution platform of EmfEngine is Windows, since it uses the
GDI+ API as a backend.
EmfEngine also provides a GDI backend
(which has some limitations: no antialiasing, no support for transparent brushes etc...).
If the GDI+ backend is disabled, EmfEngine can be compiled on Unix-like systems (Linux, Mac OS X), but
on these systems it relies on the presence of the libEMF library.
Unfortunatelly, this library is not maintained anymore. Any help from developers willing to help reviving it is most welcome.
Following the Qt distribution model, EmfEngine is available under two licenses: an open-source licence (GPL v. 3.0)
and a commercial one. Please take a look at the Licensing section for more details.
Ion Vasilief
|
|
|