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

📄 qpixmap.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.TH QPixmap 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPixmap \- Off-screen pixel-based paint device.SH SYNOPSIS.br.PP\fC#include <qpixmap.h>\fR.PPInherits QPaintDevice and Qt..PPInherited by QBitmap and QCanvasPixmap..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBColorMode\fR { Auto, Color, Mono }".br.ti -1c.BI "enum \fBOptimization\fR { DefaultOptim, NoOptim, MemoryOptim=NoOptim, NormalOptim, BestOptim }".br.ti -1c.BI "\fBQPixmap\fR () ".br.ti -1c.BI "\fBQPixmap\fR ( int " "w" ", int " "h" ", int " "depth" " = -1, Optimization = DefaultOptim ) ".br.ti -1c.BI "\fBQPixmap\fR ( const QSize &, int " "depth" " = -1, Optimization = DefaultOptim ) ".br.ti -1c.BI "\fBQPixmap\fR ( const QString & " "fileName" ", const char * " "format" "=0, ColorMode " "mode" "=Auto ) ".br.ti -1c.BI "\fBQPixmap\fR ( const QString & " "fileName" ", const char * " "format" ", int conversion_flags ) ".br.ti -1c.BI "\fBQPixmap\fR ( const char * xpm[] ) ".br.ti -1c.BI "\fBQPixmap\fR ( const QByteArray & data ) ".br.ti -1c.BI "\fBQPixmap\fR ( const QPixmap & ) ".br.ti -1c.BI "\fB~QPixmap\fR () ".br.ti -1c.BI "QPixmap& \fBoperator=\fR ( const QPixmap & ) ".br.ti -1c.BI "QPixmap& \fBoperator=\fR ( const QImage & ) ".br.ti -1c.BI "bool \fBisNull\fR () const".br.ti -1c.BI "int \fBwidth\fR () const".br.ti -1c.BI "int \fBheight\fR () const".br.ti -1c.BI "QSize \fBsize\fR () const".br.ti -1c.BI "QRect \fBrect\fR () const".br.ti -1c.BI "int \fBdepth\fR () const".br.ti -1c.BI "void \fBfill\fR ( const QColor & fillColor = Qt::white ) ".br.ti -1c.BI "void \fBfill\fR ( const QWidget *, int " "xofs" ", int yofs ) ".br.ti -1c.BI "void \fBfill\fR ( const QWidget *, const QPoint & ofs ) ".br.ti -1c.BI "void \fBresize\fR ( int " "width" ", int height ) ".br.ti -1c.BI "void \fBresize\fR ( const QSize & ) ".br.ti -1c.BI "const QBitmap* \fBmask\fR () const".br.ti -1c.BI "void \fBsetMask\fR ( const QBitmap & ) ".br.ti -1c.BI "bool \fBselfMask\fR () const".br.ti -1c.BI "QBitmap \fBcreateHeuristicMask\fR ( bool " "clipTight" " = TRUE ) const".br.ti -1c.BI "QPixmap \fBxForm\fR ( const QWMatrix & ) const".br.ti -1c.BI "QImage \fBconvertToImage\fR () const".br.ti -1c.BI "bool \fBconvertFromImage\fR ( const QImage &, ColorMode " "mode" "=Auto ) ".br.ti -1c.BI "bool \fBconvertFromImage\fR ( const QImage &, int conversion_flags ) ".br.ti -1c.BI "bool \fBload\fR ( const QString & " "fileName" ", const char * " "format" "=0, ColorMode " "mode" "=Auto ) ".br.ti -1c.BI "bool \fBload\fR ( const QString & " "fileName" ", const char * " "format" ", int conversion_flags ) ".br.ti -1c.BI "bool \fBloadFromData\fR ( const uchar * " "buf" ", uint " "len" ", const char * " "format" "=0, ColorMode " "mode" "=Auto ) ".br.ti -1c.BI "bool \fBloadFromData\fR ( const uchar * " "buf" ", uint " "len" ", const char * " "format" ", int conversion_flags ) ".br.ti -1c.BI "bool \fBloadFromData\fR ( const QByteArray & " "data" ", const char * " "format" "=0, int " "conversion_flags" "=0 ) ".br.ti -1c.BI "bool \fBsave\fR ( const QString & " "fileName" ", const char * format ) const".br.ti -1c.BI "bool \fBsave\fR ( const QString & " "fileName" ", const char * " "format" ", int quality ) const".br.ti -1c.BI "int \fBserialNumber\fR () const".br.ti -1c.BI "Optimization \fBoptimization\fR () const".br.ti -1c.BI "void \fBsetOptimization\fR ( Optimization ) ".br.ti -1c.BI "virtual void \fBdetach\fR () ".br.ti -1c.BI "bool \fBisQBitmap\fR () const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "int \fBdefaultDepth\fR () ".br.ti -1c.BI "QPixmap \fBgrabWindow\fR ( WId, int " "x" "=0, int " "y" "=0, int " "w" "=-1, int " "h" "=-1 ) ".br.ti -1c.BI "QPixmap \fBgrabWidget\fR ( QWidget * " "widget" ", int " "x" "=0, int " "y" "=0, int " "w" "=-1, int " "h" "=-1 ) ".br.ti -1c.BI "QWMatrix \fBtrueMatrix\fR ( const QWMatrix &, int " "w" ", int h ) ".br.ti -1c.BI "const char* \fBimageFormat\fR ( const QString & fileName ) ".br.ti -1c.BI "Optimization \fBdefaultOptimization\fR () ".br.ti -1c.BI "void \fBsetDefaultOptimization\fR ( Optimization ) ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "\fBQPixmap\fR ( int " "w" ", int " "h" ", const uchar * " "data" ", bool isXbitmap ) ".br.ti -1c.BI "virtual int \fBmetric\fR ( int ) const".br.in -1c.SH RELATED FUNCTION DOCUMENTATION(Note that these are not member functions.).in +1c.ti -1c.BI "QDataStream & \fBoperator>>\fR (QDataStream & " "s" ", QPixmap & " "pixmap" ")".br.ti -1c.BI "QDataStream & \fBoperator<<\fR (QDataStream & " "s" ", const QPixmap & " "pixmap" ")".br.in -1c.SH DESCRIPTIONThe QPixmap class is an off-screen pixel-based paint device..PPIt is one of the two classes Qt provides for dealing with images, the other being QImage. QPixmap is designed and optimized for drawing; QImage is designed and optimized for I/O and for direct pixel access/manipulation. There are (slow) functions to convert between QImage and QPixmap; convertToImage() and convertFromImage()..PPOne common use of the QPixmap class is to enable smooth updating of widgets. Whenever something complex needs to be drawn, you can use a pixmap to obtain flicker-free drawing, like this:.IP 1Create a pixmap with the same size as the widget..IP 2Fill the pixmap with the widget background color..IP 3Paint the pixmap..IP 4bitBlt() the pixmap contents onto the widget..PPPixel data in a pixmap is internal and managed by the underlying window system. Pixels can only be accessed through QPainter functions, through bitBlt(), and by converting the QPixmap to a QImage..PPYou can display a QPixmap on the screen easily using e.g. QLabel::setPixmap(), and all the QButton subclasses support pixmap use..PPThe QPixmap class uses lazy copying, so it is practical to pass pass QPixmap objects as arguments..PPNote about Windows 95 and 98: On Windows 9x, the system crashes if you create more than approximately 1000 pixmaps, independent of the size of the pixmaps or installed RAM. Windows NT does not have this limitation..PPQt tries to work around the resource limitation. If you set the pixmap optimization to \fCQPixmap::MemoryOptim\fR and the width of your pixmap is less than or equal to 128 pixels, Qt stores the pixmap in a way which is very memory-efficient when there are many pixmaps..PPIf your application uses dozens or hundreds of pixmaps, e.g. on tool bar buttons, in popup menus, and you plan to run it on Windows 95 or Windows 98, then we recommend using code like this:.PP.nf.br    QPixmap::setDefaultOptimization( QPixmap::MemoryOptim );.br    while ( ... ) {.br      // load tool bar pixmaps etc..br      QPixmap *pixmap = new QPixmap(fileName);.br    }.br    QPixmap::setDefaultOptimization( QPixmap::NormalOptim );.fi.PPSee also QBitmap, QImage, QImageIO and Shared Classes.PPExamples:.(lqtimage/qtimage.cpp grapher/grapher.cpp xform/xform.cpp menu/menu.cpp qmag/qmag.cpp desktop/desktop.cpp scrollview/scrollview.cpp movies/main.cpp picture/picture.cpp.)l.SS "Member Type Documentation".SH "QPixmap::ColorMode"This enum type defines the color modes that exist for converting QImage objects to QPixmap. The current values are: .TP\fCAuto\fR - select \fCColor\fR or \fCMono\fR on a case-by-case basis..TP\fCColor\fR - always create colored pixmaps..TP\fCMono\fR - always create bitmaps..SH "QPixmap::Optimization"QPixmap has the choice of optimizing for speed or memory in a few places, and the best choice varies from pixmap to pixmap, but can generally be derived heuristically. This enum type defines a number of optimization modes you can set for any pixmap, to tweak the speed/memory tradeoffs:.TP\fCDefaultOptim\fR - whatever QPixmap::defaultOptimization() returns. A pixmap with this optimization mode set always has the default optimization type, even if the default is changed with setDefaultOptimization()..TP\fCNoOptim\fR - no optimization (currently the same as \fCMemoryOptim).\fR.TP\fCMemoryOptim\fR - optimize for minimal memory use..TP\fCNormalOptim\fR - optimize for typical usage. Often uses more memory than \fCMemoryOptim,\fR and often faster..TP\fCBestOptim\fR - optimize for pixmaps that are drawn very often and where performance is critical. Generally uses more memory than \fCNormalOptim\fR and may provide a little better speed..IP.PPWe recommend sticking with \fCDefaultOptim\fR.SH MEMBER FUNCTION DOCUMENTATION.SH "QPixmap::QPixmap ()"Constructs a null pixmap..PP

⌨️ 快捷键说明

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