summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqcanvaspixmap.3qt
blob: 89245ffb2fe7fc8d04e6a73d8be07907edd40235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
'\" t
.TH TQCanvasPixmap 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQCanvasPixmap \- Pixmaps for TQCanvasSprites
.SH SYNOPSIS
\fC#include <tqcanvas.h>\fR
.PP
Inherits QPixmap.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQCanvasPixmap\fR ( const TQString & datafilename )"
.br
.ti -1c
.BI "\fBTQCanvasPixmap\fR ( const TQImage & image )"
.br
.ti -1c
.BI "\fBTQCanvasPixmap\fR ( const QPixmap & pm, const QPoint & offset )"
.br
.ti -1c
.BI "\fB~TQCanvasPixmap\fR ()"
.br
.ti -1c
.BI "int \fBoffsetX\fR () const"
.br
.ti -1c
.BI "int \fBoffsetY\fR () const"
.br
.ti -1c
.BI "void \fBsetOffset\fR ( int x, int y )"
.br
.in -1c
.SH DESCRIPTION
The TQCanvasPixmap class provides pixmaps for TQCanvasSprites.
.PP
If you want to show a single pixmap on a TQCanvas use a TQCanvasSprite with just one pixmap.
.PP
When pixmaps are inserted into a TQCanvasPixmapArray they are held as TQCanvasPixmaps. TQCanvasSprites are used to show pixmaps on TQCanvases and hold their pixmaps in a TQCanvasPixmapArray. If you retrieve a frame (pixmap) from a TQCanvasSprite it will be returned as a TQCanvasPixmap.
.PP
The pixmap is a QPixmap and can only be set in the constructor. There are three different constructors, one taking a QPixmap, one a TQImage and one a file name that refers to a file in any supported file format (see QImageIO).
.PP
TQCanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a TQCanvasPixmap from a PNG file or from a TQImage that has a TQImage::offset(), the offset() is initialized appropriately, otherwise the constructor leaves it at (0, 0). You can set it later using setOffset(). When the TQCanvasPixmap is used in a TQCanvasSprite, the offset position is the point at TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of the pixmap.
.PP
Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the position of each TQCanvasPixmap object is set so that the hotspot stays in the same position.
.PP
See also TQCanvasPixmapArray, TQCanvasItem, TQCanvasSprite, Graphics Classes, and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQCanvasPixmap::TQCanvasPixmap ( const TQString & datafilename )"
Constructs a TQCanvasPixmap that uses the image stored in \fIdatafilename\fR.
.SH "TQCanvasPixmap::TQCanvasPixmap ( const TQImage & image )"
Constructs a TQCanvasPixmap from the image \fIimage\fR.
.SH "TQCanvasPixmap::TQCanvasPixmap ( const QPixmap & pm, const QPoint & offset )"
Constructs a TQCanvasPixmap from the pixmap \fIpm\fR using the offset \fIoffset\fR.
.SH "TQCanvasPixmap::~TQCanvasPixmap ()"
Destroys the pixmap.
.SH "int TQCanvasPixmap::offsetX () const"
Returns the x-offset of the pixmap's hotspot.
.PP
See also setOffset().
.SH "int TQCanvasPixmap::offsetY () const"
Returns the y-offset of the pixmap's hotspot.
.PP
See also setOffset().
.SH "void TQCanvasPixmap::setOffset ( int x, int y )"
Sets the offset of the pixmap's hotspot to (\fIx\fR, \fIy\fR).
.PP
\fBWarning:\fR Do not call this function if any TQCanvasSprites are
currently showing this pixmap.

.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqcanvaspixmap.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If 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.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqcanvaspixmap.3qt) and the Qt
version (3.3.8).