lib Library API Documentation

QWinMetaFile Class Reference

QWinMetaFile is a WMF viewer based on QT toolkit How to use QWinMetaFile :. More...

#include <qwmf.h>

List of all members.

Public Member Functions

virtual bool load (const QString &fileName)
virtual bool load (QBuffer &buffer)
virtual bool paint (const QPaintDevice *target, bool absolute=false)
bool isPlaceable (void) const
bool isEnhanced (void) const
QRect bbox (void) const
void setWindowOrg (long num, short *parms)
void setWindowExt (long num, short *parms)
void lineTo (long num, short *parms)
void moveTo (long num, short *parms)
void ellipse (long num, short *parms)
void polygon (long num, short *parms)
void polyPolygon (long num, short *parms)
void polyline (long num, short *parms)
void rectangle (long num, short *parms)
void roundRect (long num, short *parms)
void arc (long num, short *parms)
void chord (long num, short *parms)
void pie (long num, short *parms)
void setPolyFillMode (long num, short *parms)
void setBkColor (long num, short *parms)
void setBkMode (long num, short *parms)
void setPixel (long num, short *parms)
void setRop (long num, short *parms)
void saveDC (long num, short *parms)
void restoreDC (long num, short *parms)
void intersectClipRect (long num, short *parms)
void excludeClipRect (long num, short *parms)
void setTextColor (long num, short *parms)
void setTextAlign (long num, short *parms)
void textOut (long num, short *parms)
void extTextOut (long num, short *parms)
void dibBitBlt (long num, short *parms)
void dibStretchBlt (long num, short *parms)
void stretchDib (long num, short *parms)
void dibCreatePatternBrush (long num, short *parms)
void selectObject (long num, short *parms)
void deleteObject (long num, short *parms)
void createEmptyObject (long num, short *parms)
void createBrushIndirect (long num, short *parms)
void createPenIndirect (long num, short *parms)
void createFontIndirect (long num, short *parms)
void noop (long, short *)
void end (long, short *)
int dpi (void) const

Protected Member Functions

unsigned short calcCheckSum (WmfPlaceableHeader *)
virtual int findFunc (unsigned short aFunc) const
QPointArray * pointArray (short num, short *parms)
QColor color (short *parm)
unsigned int toDWord (short *parm)
void xyToAngle (int xStart, int yStart, int xEnd, int yEnd, int &angle, int &aLength)
void addHandle (WinObjHandle *)
void deleteHandle (int)
Qt::RasterOp winToQtRaster (short parm) const
Qt::RasterOp winToQtRaster (long parm) const
bool dibToBmp (QImage &bmp, const char *dib, long size)

Protected Attributes

QPainter mPainter
bool mIsPlaceable
bool mIsEnhanced
bool mValid
bool mAbsoluteCoord
QWMatrix mInternalWorldMatrix
QRect mHeaderBoundingBox
QRect mBBox
QColor mTextColor
int mTextAlign
int mRotation
bool mWinding
WmfCmd * mFirstCmd
WinObjHandle ** mObjHandleTab
QPointArray mPoints
int mDpi


Detailed Description

QWinMetaFile is a WMF viewer based on QT toolkit How to use QWinMetaFile :.

 * #include "qwmf.h"
 QWinMetaFile wmf;
 QPicture pic;     // or QImage pic;
 if ( wmf.load( filename )
 *    wmf.paint( &pic );
 

Definition at line 52 of file qwmf.h.


Member Function Documentation

bool QWinMetaFile::load (  const QString &  fileName  )  [virtual]
 

Load WMF file.

Returns:
true on success.

Definition at line 133 of file qwmf.cc.

References load().

Referenced by load().

bool QWinMetaFile::paint (  const QPaintDevice *  target,
bool  absolute = false
)  [virtual]
 

Paint metafile to given paint-device using absolute or relative coordinate.

  • absolute coord. Reset the world transfomation Matrix
  • relative coord. Use the existing world transfomation Matrix

Returns:
true on success.

Definition at line 332 of file qwmf.cc.

References noop(), and paint().

Referenced by paint().

bool QWinMetaFile::isPlaceable (  void   )  const [inline]
 

Returns:
true if the metafile is placeable.

Definition at line 77 of file qwmf.h.

bool QWinMetaFile::isEnhanced (  void   )  const [inline]
 

Returns:
true if the metafile is enhanced.

Definition at line 82 of file qwmf.h.

QRect QWinMetaFile::bbox (  void   )  const [inline]
 

Returns:
bounding rectangle

Definition at line 87 of file qwmf.h.

Referenced by excludeClipRect(), intersectClipRect(), and polyPolygon().

void QWinMetaFile::setWindowOrg (  long  num,
short *  parms
) 
 

set window origin

Definition at line 405 of file qwmf.cc.

References setWindowOrg(), and QPainter::translate().

Referenced by setWindowOrg().

void QWinMetaFile::setWindowExt (  long  num,
short *  parms
) 
 

set window extents

Definition at line 424 of file qwmf.cc.

References QPainter::scale(), setWindowExt(), and QPainter::translate().

Referenced by setWindowExt().

void QWinMetaFile::lineTo (  long  num,
short *  parms
) 
 

draw line to coord

Definition at line 459 of file qwmf.cc.

References lineTo().

Referenced by lineTo().

void QWinMetaFile::moveTo (  long  num,
short *  parms
) 
 

move pen to coord

Definition at line 466 of file qwmf.cc.

References moveTo().

Referenced by moveTo().

void QWinMetaFile::ellipse (  long  num,
short *  parms
) 
 

draw ellipse

Definition at line 473 of file qwmf.cc.

References ellipse().

Referenced by ellipse().

void QWinMetaFile::polygon (  long  num,
short *  parms
) 
 

draw polygon

Definition at line 480 of file qwmf.cc.

References pointArray(), and polygon().

Referenced by polygon().

void QWinMetaFile::polyPolygon (  long  num,
short *  parms
) 
 

draw a list of polygons

Definition at line 490 of file qwmf.cc.

References bbox(), pointArray(), and polyPolygon().

Referenced by polyPolygon().

void QWinMetaFile::polyline (  long  num,
short *  parms
) 
 

draw series of lines

Definition at line 533 of file qwmf.cc.

References pointArray(), and polyline().

Referenced by polyline().

void QWinMetaFile::rectangle (  long  num,
short *  parms
) 
 

draw a rectangle

Definition at line 543 of file qwmf.cc.

References rectangle().

Referenced by rectangle().

void QWinMetaFile::roundRect (  long  num,
short *  parms
) 
 

draw round rectangle

Definition at line 550 of file qwmf.cc.

References roundRect().

Referenced by roundRect().

void QWinMetaFile::arc (  long  num,
short *  parms
) 
 

draw arc

Definition at line 565 of file qwmf.cc.

References arc(), and xyToAngle().

Referenced by arc().

void QWinMetaFile::chord (  long  num,
short *  parms
) 
 

draw chord

Definition at line 579 of file qwmf.cc.

References chord(), and xyToAngle().

Referenced by chord().

void QWinMetaFile::pie (  long  num,
short *  parms
) 
 

draw pie

Definition at line 593 of file qwmf.cc.

References pie(), and xyToAngle().

Referenced by pie().

void QWinMetaFile::setPolyFillMode (  long  num,
short *  parms
) 
 

set polygon fill mode

Definition at line 607 of file qwmf.cc.

References setPolyFillMode().

Referenced by setPolyFillMode().

void QWinMetaFile::setBkColor (  long  num,
short *  parms
) 
 

set background pen color

Definition at line 614 of file qwmf.cc.

References color(), and setBkColor().

Referenced by setBkColor().

void QWinMetaFile::setBkMode (  long  num,
short *  parms
) 
 

set background pen mode

Definition at line 621 of file qwmf.cc.

References setBkMode().

Referenced by setBkMode().

void QWinMetaFile::setPixel (  long  num,
short *  parms
) 
 

set a pixel

Definition at line 629 of file qwmf.cc.

References color(), and setPixel().

Referenced by setPixel().

void QWinMetaFile::setRop (  long  num,
short *  parms
) 
 

Set raster operation mode.

Definition at line 639 of file qwmf.cc.

References setRop(), and winToQtRaster().

Referenced by setRop().

void QWinMetaFile::saveDC (  long  num,
short *  parms
) 
 

save device context

Definition at line 646 of file qwmf.cc.

References saveDC().

Referenced by saveDC().

void QWinMetaFile::restoreDC (  long  num,
short *  parms
) 
 

restore device context

Definition at line 653 of file qwmf.cc.

References restoreDC().

Referenced by restoreDC().

void QWinMetaFile::intersectClipRect (  long  num,
short *  parms
) 
 

clipping region is the intersection of this region and the original region

Definition at line 661 of file qwmf.cc.

References bbox(), and intersectClipRect().

Referenced by intersectClipRect().

void QWinMetaFile::excludeClipRect (  long  num,
short *  parms
) 
 

delete a clipping rectangle of the original region

Definition at line 678 of file qwmf.cc.

References bbox(), and excludeClipRect().

Referenced by excludeClipRect().

void QWinMetaFile::setTextColor (  long  num,
short *  parms
) 
 

set text color

Definition at line 697 of file qwmf.cc.

References color(), and setTextColor().

Referenced by setTextColor().

void QWinMetaFile::setTextAlign (  long  num,
short *  parms
) 
 

set text alignment

Definition at line 704 of file qwmf.cc.

References setTextAlign().

Referenced by setTextAlign().

void QWinMetaFile::textOut (  long  num,
short *  parms
) 
 

draw text

Definition at line 711 of file qwmf.cc.

References textOut().

Referenced by textOut().

void QWinMetaFile::dibBitBlt (  long  num,
short *  parms
) 
 

copies a DIB into a dest location

Definition at line 795 of file qwmf.cc.

References dibBitBlt(), dibToBmp(), toDWord(), and winToQtRaster().

Referenced by dibBitBlt().

void QWinMetaFile::dibStretchBlt (  long  num,
short *  parms
) 
 

stretches a DIB into a dest location

Definition at line 826 of file qwmf.cc.

References dibStretchBlt(), dibToBmp(), toDWord(), and winToQtRaster().

Referenced by dibStretchBlt().

void QWinMetaFile::dibCreatePatternBrush (  long  num,
short *  parms
) 
 

create a pattern brush

Definition at line 884 of file qwmf.cc.

References addHandle(), dibCreatePatternBrush(), and dibToBmp().

Referenced by dibCreatePatternBrush().

void QWinMetaFile::selectObject (  long  num,
short *  parms
) 
 

Activate object handle.

Definition at line 900 of file qwmf.cc.

References selectObject().

Referenced by selectObject().

void QWinMetaFile::deleteObject (  long  num,
short *  parms
) 
 

Free object handle.

Definition at line 909 of file qwmf.cc.

References deleteObject().

Referenced by deleteObject().

void QWinMetaFile::createEmptyObject (  long  num,
short *  parms
) 
 

create an empty object in the object list

Definition at line 916 of file qwmf.cc.

References addHandle(), and createEmptyObject().

Referenced by createEmptyObject().

void QWinMetaFile::createBrushIndirect (  long  num,
short *  parms
) 
 

create a logical brush

Definition at line 926 of file qwmf.cc.

References addHandle(), color(), and createBrushIndirect().

Referenced by createBrushIndirect().

void QWinMetaFile::createPenIndirect (  long  num,
short *  parms
) 
 

create a logical pen

Definition at line 976 of file qwmf.cc.

References addHandle(), color(), and createPenIndirect().

Referenced by createPenIndirect().

void QWinMetaFile::createFontIndirect (  long  num,
short *  parms
) 
 

create a logical font

Definition at line 1013 of file qwmf.cc.

References addHandle(), and createFontIndirect().

Referenced by createFontIndirect().

void QWinMetaFile::noop (  long  ,
short * 
) 
 

nothing to do

Definition at line 1035 of file qwmf.cc.

References noop().

Referenced by noop(), and paint().

void QWinMetaFile::end (  long  ,
short * 
) 
 

end of meta file

Definition at line 1040 of file qwmf.cc.

References end().

Referenced by end().

int QWinMetaFile::dpi (  void   )  const [inline]
 

Resolution of the image in dots per inch.

Definition at line 177 of file qwmf.h.

unsigned short QWinMetaFile::calcCheckSum (  WmfPlaceableHeader *   )  [protected]
 

Calculate header checksum.

Definition at line 1048 of file qwmf.cc.

References calcCheckSum().

Referenced by calcCheckSum().

int QWinMetaFile::findFunc (  unsigned short  aFunc  )  const [protected, virtual]
 

Find function in metafunc table by metafile-function.

Returns index or -1 if not found.

Definition at line 1065 of file qwmf.cc.

References findFunc().

Referenced by findFunc().

QPointArray * QWinMetaFile::pointArray (  short  num,
short *  parms
)  [protected]
 

Fills given parms into mPoints.

Definition at line 1077 of file qwmf.cc.

References pointArray().

Referenced by pointArray(), polygon(), polyline(), and polyPolygon().

QColor QWinMetaFile::color (  short *  parm  )  [protected]
 

Returns color given by the two parameters.

Definition at line 1112 of file qwmf.cc.

References color(), and toDWord().

Referenced by color(), createBrushIndirect(), createPenIndirect(), setBkColor(), setPixel(), and setTextColor().

unsigned int QWinMetaFile::toDWord (  short *  parm  )  [protected]
 

Converts two parameters to long.

Definition at line 1090 of file qwmf.cc.

References toDWord().

Referenced by color(), dibBitBlt(), dibStretchBlt(), and toDWord().

void QWinMetaFile::xyToAngle (  int  xStart,
int  yStart,
int  xEnd,
int  yEnd,
int &  angle,
int &  aLength
)  [protected]
 

Convert (x1,y1) and (x2, y2) positions in angle and angleLength.

Definition at line 1127 of file qwmf.cc.

References xyToAngle().

Referenced by arc(), chord(), pie(), and xyToAngle().

void QWinMetaFile::addHandle (  WinObjHandle *   )  [protected]
 

Handle win-object-handles.

Definition at line 1141 of file qwmf.cc.

References addHandle().

Referenced by addHandle(), createBrushIndirect(), createEmptyObject(), createFontIndirect(), createPenIndirect(), and dibCreatePatternBrush().

Qt::RasterOp QWinMetaFile::winToQtRaster (  short  parm  )  const [protected]
 

Convert windows rasterOp in QT rasterOp.

Definition at line 1165 of file qwmf.cc.

References winToQtRaster().

Referenced by dibBitBlt(), dibStretchBlt(), setRop(), and winToQtRaster().

bool QWinMetaFile::dibToBmp (  QImage &  bmp,
const char *  dib,
long  size
)  [protected]
 

Converts DIB to BMP.

Definition at line 1225 of file qwmf.cc.

References dibToBmp().

Referenced by dibBitBlt(), dibCreatePatternBrush(), dibStretchBlt(), and dibToBmp().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 06:54:23 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003