⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qpicture.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QPicture 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPicture \- Paint device that records and replays QPainter commands.SH SYNOPSIS\fC#include <qpicture.h>\fR.PPInherits QPaintDevice..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQPicture\fR ( int formatVersion = -1 )".br.ti -1c.BI "\fBQPicture\fR ( const QPicture & pic )".br.ti -1c.BI "\fB~QPicture\fR ()".br.ti -1c.BI "bool \fBisNull\fR () const".br.ti -1c.BI "uint \fBsize\fR () const".br.ti -1c.BI "const char * \fBdata\fR () const".br.ti -1c.BI "virtual void \fBsetData\fR ( const char * data, uint size )".br.ti -1c.BI "bool \fBplay\fR ( QPainter * painter )".br.ti -1c.BI "bool \fBload\fR ( QIODevice * dev, const char * format = 0 )".br.ti -1c.BI "bool \fBload\fR ( const QString & fileName, const char * format = 0 )".br.ti -1c.BI "bool \fBsave\fR ( QIODevice * dev, const char * format = 0 )".br.ti -1c.BI "bool \fBsave\fR ( const QString & fileName, const char * format = 0 )".br.ti -1c.BI "QRect \fBboundingRect\fR () const".br.ti -1c.BI "void \fBsetBoundingRect\fR ( const QRect & r )".br.ti -1c.BI "QPicture & \fBoperator=\fR ( const QPicture & p )".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual int \fBmetric\fR ( int m ) const".br.ti -1c.BI "void \fBdetach\fR ()".br.ti -1c.BI "QPicture \fBcopy\fR () const".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QPicture & r )".br.ti -1c.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QPicture & r )".br.in -1c.SH DESCRIPTIONThe QPicture class is a paint device that records and replays QPainter commands..PPA picture serializes painter commands to an IO device in a platform-independent format. For example, a picture created under Windows can be read on a Sun SPARC..PPPictures are called meta-files on some platforms..PPQt pictures use a proprietary binary format. Unlike native picture (meta-file) formats on many window systems, Qt pictures have no limitations regarding their contents. Everything that can be painted can also be stored in a picture, e.g. fonts, pixmaps, regions, transformed graphics, etc..PPQPicture is an implicitly shared class..PPExample of how to record a picture:.PP.nf.br    QPicture  pic;.br    QPainter  p;.br    p.begin( &pic );               // paint in picture.br    p.drawEllipse( 10,20, 80,70 ); // draw an ellipse.br    p.end();                       // painting done.br    pic.save( "drawing.pic" );     // save picture.br.fi.PPExample of how to replay a picture:.PP.nf.br    QPicture  pic;.br    pic.load( "drawing.pic" );     // load picture.br    QPainter  p;.br    p.begin( &myWidget );          // paint in myWidget.br    p.drawPicture( pic );          // draw the picture.br    p.end();                       // painting done.br.fi.PPPictures can also be drawn using play(). Some basic data about a picture is available, for example, size(), isNull() and boundingRect()..PPSee also Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QPicture::QPicture ( int formatVersion = -1 )"Constructs an empty picture..PPThe \fIformatVersion\fR parameter may be used to \fIcreate\fR a QPicture that can be read by applications that are compiled with earlier versions of Qt..TP\fIformatVersion\fR == 1 is binary compatible with Qt 1.x and later..TP\fIformatVersion\fR == 2 is binary compatible with Qt 2.0.x and later..TP\fIformatVersion\fR == 3 is binary compatible with Qt 2.1.x and later..TP\fIformatVersion\fR == 4 is binary compatible with Qt 3.0.x and later..TP\fIformatVersion\fR == 5 is binary compatible with Qt 3.1..PPNote that the default formatVersion is -1 which signifies the current release, i.e. for Qt 3.1 a formatVersion of 5 is the same as the default formatVersion of -1..PPReading pictures generated by earlier versions of Qt is supported and needs no special coding; the format is automatically detected..SH "QPicture::QPicture ( const QPicture & pic )"Constructs a shallow copy of \fIpic\fR..SH "QPicture::~QPicture ()"Destroys the picture..SH "QRect QPicture::boundingRect () const"Returns the picture's bounding rectangle or an invalid rectangle if the picture contains no data..SH "QPicture QPicture::copy () const\fC [protected]\fR"Returns a deep copy of the picture..SH "const char * QPicture::data () const"Returns a pointer to the picture data. The pointer is only valid until the next non-const function is called on this picture. The returned pointer is 0 if the picture contains no data..PPSee also size() and isNull()..SH "void QPicture::detach ()\fC [protected]\fR"Detaches from shared picture data and makes sure that this picture is the only one referring to the data..PPIf multiple pictures share common data, this picture makes a copy of the data and detaches itself from the sharing mechanism. Nothing is done if there is just a single reference..SH "bool QPicture::isNull () const"Returns TRUE if the picture contains no data; otherwise returns FALSE..SH "bool QPicture::load ( const QString & fileName, const char * format = 0 )"Loads a picture from the file specified by \fIfileName\fR and returns TRUE if successful; otherwise returns FALSE..PPBy default, the file will be interpreted as being in the native QPicture format. Specifying the \fIformat\fR string is optional and is only needed for importing picture data stored in a different format..PPCurrently, the only external format supported is the W3C SVG format which requires the Qt XML module. The corresponding \fIformat\fR string is "svg"..PPSee also save()..PPExamples:.)l picture/picture.cpp and xform/xform.cpp..SH "bool QPicture::load ( QIODevice * dev, const char * format = 0 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PP\fIdev\fR is the device to use for loading..SH "int QPicture::metric ( int m ) const\fC [virtual protected]\fR"Internal implementation of the virtual QPaintDevice::metric() function..PPUse the QPaintDeviceMetrics class instead..PPA picture has the following hard-coded values: dpi=72, numcolors=16777216 and depth=24..PP\fIm\fR is the metric to get..SH "QPicture & QPicture::operator= ( const QPicture & p )"Assigns a shallow copy of \fIp\fR to this picture and returns a reference to this picture..SH "bool QPicture::play ( QPainter * painter )"Replays the picture using \fIpainter\fR, and returns TRUE if successful; otherwise returns FALSE..PPThis function does exactly the same as QPainter::drawPicture() with (x, y) = (0, 0)..SH "bool QPicture::save ( const QString & fileName, const char * format = 0 )"Saves a picture to the file specified by \fIfileName\fR and returns TRUE if successful; otherwise returns FALSE..PPSpecifying the file \fIformat\fR string is optional. It's not recommended unless you intend to export the picture data for use by a third party reader. By default the data will be saved in the native QPicture file format..PPCurrently, the only external format supported is the W3C SVG format which requires the Qt XML module. The corresponding \fIformat\fR string is "svg"..PPSee also load()..PPExample: picture/picture.cpp..SH "bool QPicture::save ( QIODevice * dev, const char * format = 0 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PP\fIdev\fR is the device to use for saving..SH "void QPicture::setBoundingRect ( const QRect & r )"Sets the picture's bounding rectangle to \fIr\fR. The automatically calculated value is overriden..SH "void QPicture::setData ( const char * data, uint size )\fC [virtual]\fR"Sets the picture data directly from \fIdata\fR and \fIsize\fR. This function copies the input data..PPSee also data() and size()..SH "uint QPicture::size () const"Returns the size of the picture data..PPSee also data()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< ( QDataStream & s, const QPicture & r )"Writes picture \fIr\fR to the stream \fIs\fR and returns a reference to the stream..SH "QDataStream & operator>> ( QDataStream & s, QPicture & r )"Reads a picture from the stream \fIs\fR into picture \fIr\fR and returnsa reference to the stream..SH "SEE ALSO".BR http://doc.trolltech.com/qpicture.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qpicture.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -