source: trunk/doc/html/qcanvaspixmap.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 6.3 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/canvas/qcanvas.cpp:2800 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QCanvasPixmap Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QCanvasPixmap Class Reference<br><small>[<a href="canvas.html">canvas module</a>]</small></h1>
33
34<p>The QCanvasPixmap class provides pixmaps for QCanvasSprites.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qcanvas-h.html">qcanvas.h</a>&gt;</tt>
37<p>Inherits <a href="qpixmap.html">QPixmap</a>.
38<p><a href="qcanvaspixmap-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QCanvasPixmap"><b>QCanvasPixmap</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;datafilename )</li>
42<li class=fn><a href="#QCanvasPixmap-2"><b>QCanvasPixmap</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;image )</li>
43<li class=fn><a href="#QCanvasPixmap-3"><b>QCanvasPixmap</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pm, const&nbsp;QPoint&nbsp;&amp;&nbsp;offset )</li>
44<li class=fn><a href="#~QCanvasPixmap"><b>~QCanvasPixmap</b></a> ()</li>
45<li class=fn>int <a href="#offsetX"><b>offsetX</b></a> () const</li>
46<li class=fn>int <a href="#offsetY"><b>offsetY</b></a> () const</li>
47<li class=fn>void <a href="#setOffset"><b>setOffset</b></a> ( int&nbsp;x, int&nbsp;y )</li>
48</ul>
49<hr><a name="details"></a><h2>Detailed Description</h2>
50
51
52The QCanvasPixmap class provides pixmaps for QCanvasSprites.
53
54<p>
55
56
57<p> If you want to show a single pixmap on a <a href="qcanvas.html">QCanvas</a> use a
58<a href="qcanvassprite.html">QCanvasSprite</a> with just one pixmap.
59<p> When pixmaps are inserted into a <a href="qcanvaspixmaparray.html">QCanvasPixmapArray</a> they are held
60as QCanvasPixmaps. <a href="qcanvassprite.html">QCanvasSprite</a>s are used to show pixmaps on
61<a href="qcanvas.html">QCanvas</a>es and hold their pixmaps in a QCanvasPixmapArray. If
62you retrieve a frame (pixmap) from a QCanvasSprite it will be
63returned as a QCanvasPixmap.
64<p> The pixmap is a <a href="qpixmap.html">QPixmap</a> and can only be set in the constructor.
65There are three different constructors, one taking a QPixmap, one
66a <a href="qimage.html">QImage</a> and one a file name that refers to a file in any
67supported file format (see <a href="qimageio.html">QImageIO</a>).
68<p> QCanvasPixmap can have a hotspot which is defined in terms of an (x,
69y) offset. When you create a QCanvasPixmap from a PNG file or from
70a QImage that has a <a href="qimage.html#offset">QImage::offset</a>(), the offset() is initialized
71appropriately, otherwise the constructor leaves it at (0, 0). You
72can set it later using <a href="#setOffset">setOffset</a>(). When the QCanvasPixmap is used
73in a <a href="qcanvassprite.html">QCanvasSprite</a>, the offset position is the point at
74<a href="qcanvasitem.html#x">QCanvasItem::x</a>() and <a href="qcanvasitem.html#y">QCanvasItem::y</a>(), not the top-left corner of
75the pixmap.
76<p> Note that for QCanvasPixmap objects created by a QCanvasSprite, the
77position of each QCanvasPixmap object is set so that the hotspot
78stays in the same position.
79<p> <p>See also <a href="qcanvaspixmaparray.html">QCanvasPixmapArray</a>, <a href="qcanvasitem.html">QCanvasItem</a>, <a href="qcanvassprite.html">QCanvasSprite</a>, <a href="graphics.html">Graphics Classes</a>, and <a href="images.html">Image Processing Classes</a>.
80
81<hr><h2>Member Function Documentation</h2>
82<h3 class=fn><a name="QCanvasPixmap"></a>QCanvasPixmap::QCanvasPixmap ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;datafilename )
83</h3>
84Constructs a QCanvasPixmap that uses the image stored in <em>datafilename</em>.
85
86<h3 class=fn><a name="QCanvasPixmap-2"></a>QCanvasPixmap::QCanvasPixmap ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;image )
87</h3>
88Constructs a QCanvasPixmap from the image <em>image</em>.
89
90<h3 class=fn><a name="QCanvasPixmap-3"></a>QCanvasPixmap::QCanvasPixmap ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pm, const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;offset )
91</h3>
92Constructs a QCanvasPixmap from the pixmap <em>pm</em> using the offset
93<em>offset</em>.
94
95<h3 class=fn><a name="~QCanvasPixmap"></a>QCanvasPixmap::~QCanvasPixmap ()
96</h3>
97Destroys the pixmap.
98
99<h3 class=fn>int <a name="offsetX"></a>QCanvasPixmap::offsetX () const
100</h3>
101
102<p> Returns the x-offset of the pixmap's hotspot.
103<p> <p>See also <a href="#setOffset">setOffset</a>().
104
105<h3 class=fn>int <a name="offsetY"></a>QCanvasPixmap::offsetY () const
106</h3>
107
108<p> Returns the y-offset of the pixmap's hotspot.
109<p> <p>See also <a href="#setOffset">setOffset</a>().
110
111<h3 class=fn>void <a name="setOffset"></a>QCanvasPixmap::setOffset ( int&nbsp;x, int&nbsp;y )
112</h3>
113
114<p> Sets the offset of the pixmap's hotspot to (<em>x</em>, <em>y</em>).
115<p> <b>Warning:</b> Do not call this function if any QCanvasSprites are
116currently showing this pixmap.
117
118<!-- eof -->
119<hr><p>
120This file is part of the <a href="index.html">Qt toolkit</a>.
121Copyright &copy; 1995-2007
122<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
123<table width=100% cellspacing=0 border=0><tr>
124<td>Copyright &copy; 2007
125<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
126<td align=right><div align=right>Qt 3.3.8</div>
127</table></div></address></body>
128</html>
Note: See TracBrowser for help on using the repository browser.