45 #include <QtGui/qpaintdevice.h> 46 #include <QtGui/qcolor.h> 47 #include <QtCore/qnamespace.h> 48 #include <QtCore/qstring.h> 49 #include <QtCore/qsharedpointer.h> 50 #include <QtGui/qimage.h> 51 #include <QtGui/qtransform.h> 55 #if defined(Q_OS_SYMBIAN) 79 #ifndef QT_NO_IMAGEFORMAT_XPM 80 QPixmap(
const char *
const xpm[]);
86 #ifdef Q_COMPILER_RVALUE_REFS 88 {
qSwap(data, other.data);
return *
this; }
117 bool hasAlpha()
const;
118 bool hasAlphaChannel()
const;
120 #ifndef QT_NO_IMAGE_HEURISTIC_MASK 121 QBitmap createHeuristicMask(
bool clipTight =
true)
const;
126 static QPixmap grabWindow(
WId,
int x=0,
int y=0,
int w=-1,
int h=-1);
129 {
return grabWidget(widget,
QRect(x, y, w, h)); }
134 {
return scaled(
QSize(w, h), aspectMode, mode); }
151 bool save(
const QString& fileName,
const char*
format = 0,
int quality = -1)
const;
152 bool save(
QIODevice* device,
const char*
format = 0,
int quality = -1)
const;
156 #if defined(Q_WS_WIN) 164 HICON toWinHICON()
const;
167 static QPixmap fromWinHICON(HICON hicon);
170 #if defined(Q_WS_MAC) 175 #if defined(Q_OS_SYMBIAN) 176 CFbsBitmap *toSymbianCFbsBitmap()
const;
177 static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *bitmap);
178 RSgImage* toSymbianRSgImage()
const;
179 static QPixmap fromSymbianRSgImage(RSgImage *sgImage);
182 inline QPixmap copy(
int x,
int y,
int width,
int height)
const;
185 inline void scroll(
int dx,
int dy,
int x,
int y,
int width,
int height,
QRegion *exposed = 0);
186 void scroll(
int dx,
int dy,
const QRect &rect,
QRegion *exposed = 0);
193 bool isDetached()
const;
196 bool isQBitmap()
const;
198 #if defined(Q_WS_QWS) 199 const uchar *qwsBits()
const;
200 int qwsBytesPerLine()
const;
206 #elif defined(Q_WS_MAC) 210 #elif defined(Q_WS_X11) 211 enum ShareMode { ImplicitlyShared, ExplicitlyShared };
213 static QPixmap fromX11Pixmap(
Qt::HANDLE pixmap, ShareMode mode = ImplicitlyShared);
214 static int x11SetDefaultScreen(
int screen);
215 void x11SetScreen(
int screen);
220 #if defined(Q_WS_X11) || defined(Q_WS_QWS) 233 enum ColorMode { Auto,
Color, Mono };
235 QT3_SUPPORT
bool load(
const QString& fileName,
const char *format, ColorMode mode);
236 QT3_SUPPORT
bool loadFromData(
const uchar *buf,
uint len,
const char* format, ColorMode mode);
237 QT3_SUPPORT_CONSTRUCTOR QPixmap(
const QImage& image);
238 QT3_SUPPORT QPixmap &operator=(
const QImage &);
239 inline QT3_SUPPORT
QImage convertToImage()
const {
return toImage(); }
240 QT3_SUPPORT
bool convertFromImage(
const QImage &, ColorMode mode);
241 inline QT3_SUPPORT
operator QImage()
const {
return toImage(); }
242 inline QT3_SUPPORT QPixmap xForm(
const QMatrix &matrix)
const {
return transformed(
QTransform(matrix)); }
243 inline QT3_SUPPORT
bool selfMask()
const {
return false; }
245 void resize_helper(
const QSize &s);
247 inline QT3_SUPPORT
void resize(
const QSize &s) { resize_helper(s); }
248 inline QT3_SUPPORT
void resize(
int width,
int height) { resize_helper(
QSize(width, height)); }
257 enum Type { PixmapType, BitmapType };
259 void init(
int,
int,
Type = PixmapType);
262 void init(
int,
int,
int);
264 #if defined(Q_WS_WIN) 265 void initAlphaPixmap(
uchar *bytes,
int length,
struct tagBITMAPINFO *bmi);
278 friend class QSymbianRasterPixmapData;
287 #if !defined(QT_NO_DATASTREAM) 304 return copy(
QRect(ax, ay, awidth, aheight));
309 scroll(dx, dy,
QRect(ax, ay, awidth, aheight), exposed);
313 Qt::ImageConversionFlags flags)
315 return loadFromData(reinterpret_cast<const uchar *>(buf.
constData()), buf.
size(),
format, flags);
322 #if !defined(QT_NO_DATASTREAM) 332 int sx=0,
int sy=0,
int sw=-1,
int sh=-1);
333 #endif // QT3_SUPPORT The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
CGImageRef qt_mac_create_imagemask(const QPixmap &pixmap, const QRectF &sr)
HBitmapFormat
HBITMAP and QPixmap is performed.
#define Q_DUMMY_COMPARISON_OPERATOR(C)
Q_GUI_EXPORT qint64 qt_pixmap_id(const QPixmap &pixmap)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
Q_GUI_EXPORT int qt_mac_pixmap_get_bytes_per_line(const QPixmap *pix)
The QMatrix class specifies 2D transformations of a coordinate system.
IconRef qt_mac_create_iconref(const QPixmap &px)
QExplicitlySharedDataPointer< QPixmapData > data
static QPixmap grabWidget(QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
The QByteArray class provides an array of bytes.
void fill(const QWidget *widget, int xofs, int yofs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator!() const
Returns true if this is a null pixmap; otherwise returns false.
QPixmap scaled(int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
struct CGImage * CGImageRef
static int defaultDepth()
The QString class provides a Unicode character string.
virtual int devType() const
QExplicitlySharedDataPointer< QPixmapData > DataPtr
#define Q_DECLARE_SHARED(TYPE)
The QBitmap class provides monochrome (1-bit depth) pixmaps.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
The QImageWriter class provides a format independent interface for writing images to files or other d...
CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
Returns the CoreGraphics CGContextRef of the paint device.
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QPixmap &)
void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed=0)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
The QRegion class specifies a clip region for a painter.
bool loadFromData(const uchar *buf, uint len, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
Loads a pixmap from the len first bytes of the given binary data.
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
The QImageReader class provides a format independent interface for reading images from files or other...
void qSwap(T &value1, T &value2)
const char * constData() const
Returns a pointer to the data stored in the byte array.
virtual QPaintEngine * paintEngine() const =0
The QX11Info class provides information about the X display configuration.
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QPixmap &)
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
int size() const
Returns the number of bytes in this byte array.
virtual int metric(PaintDeviceMetric metric) const
Q_GUI_EXPORT quint32 * qt_mac_pixmap_get_base(const QPixmap *pix)
The QPixmap class is an off-screen image representation that can be used as a paint device...
void swap(QPixmap &other)
Swaps pixmap other with this pixmap.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QDataStream class provides serialization of binary data to a QIODevice.
struct CGContext * CGContextRef
The QIODevice class is the base interface class of all I/O devices in Qt.
static QString fileName(const QString &fileUrl)
static bool isNull(const QVariant::Private *d)
struct OpaqueIconRef * IconRef