📄 qcanvaspixmap.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/canvas/qcanvas.cpp:2667 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QCanvasPixmap Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><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><p>The QCanvasPixmap class provides pixmaps for QCanvasSprites.<a href="#details">More...</a><p><tt>#include <<a href="qcanvas-h.html">qcanvas.h</a>></tt><p>Inherits <a href="qpixmap.html">QPixmap</a>.<p><a href="qcanvaspixmap-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QCanvasPixmap"><b>QCanvasPixmap</b></a> ( const QString & datafilename )</div></li><li><div class=fn><a href="#QCanvasPixmap-2"><b>QCanvasPixmap</b></a> ( const QImage & image )</div></li><li><div class=fn><a href="#QCanvasPixmap-3"><b>QCanvasPixmap</b></a> ( const QPixmap & pm, const QPoint & offset )</div></li><li><div class=fn><a href="#~QCanvasPixmap"><b>~QCanvasPixmap</b></a> ()</div></li><li><div class=fn>int <a href="#offsetX"><b>offsetX</b></a> () const</div></li><li><div class=fn>int <a href="#offsetY"><b>offsetY</b></a> () const</div></li><li><div class=fn>void <a href="#setOffset"><b>setOffset</b></a> ( int x, int y )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QCanvasPixmap class provides pixmaps for QCanvasSprites.<p> <p> If you want to show a single pixmap on a <a href="qcanvas.html">QCanvas</a> use a<a href="qcanvassprite.html">QCanvasSprite</a> with just one pixmap.<p> When pixmaps are inserted into a <a href="qcanvaspixmaparray.html">QCanvasPixmapArray</a> they are heldas QCanvasPixmaps. <a href="qcanvassprite.html">QCanvasSprite</a>s are used to show pixmaps on<a href="qcanvas.html">QCanvas</a>es and hold their pixmaps in a QCanvasPixmapArray. Ifyou retrieve a frame (pixmap) from a QCanvasSprite it will bereturned as a QCanvasPixmap.<p> The pixmap is a <a href="qpixmap.html">QPixmap</a> and can only be set in the constructor.There are three different constructors, one taking a QPixmap, onea <a href="qimage.html">QImage</a> and one a file name that refers to a file in anysupported file format (see <a href="qimageio.html">QImageIO</a>).<p> QCanvasPixmap can have a hotspot which is defined in terms of an (x,y) offset. When you create a QCanvasPixmap from a PNG file or froma QImage that has a <a href="qimage.html#offset">QImage::offset</a>(), the offset() is initializedappropriately, otherwise the constructor leaves it at (0, 0). Youcan set it later using <a href="#setOffset">setOffset</a>(). When the QCanvasPixmap is usedin a <a href="qcanvassprite.html">QCanvasSprite</a>, the offset position is the point at<a href="qcanvasitem.html#x">QCanvasItem::x</a>() and <a href="qcanvasitem.html#y">QCanvasItem::y</a>(), not the top-left corner ofthe pixmap.<p> Note that for QCanvasPixmap objects created by a QCanvasSprite, theposition of each QCanvasPixmap object is set so that the hotspotstays in the same position.<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>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QCanvasPixmap"></a>QCanvasPixmap::QCanvasPixmap ( const <a href="qstring.html">QString</a> & datafilename )</h3>Constructs a QCanvasPixmap that uses the image stored in<em>datafilename</em>.<h3 class=fn><a name="QCanvasPixmap-2"></a>QCanvasPixmap::QCanvasPixmap ( const <a href="qimage.html">QImage</a> & image )</h3>Constructs a QCanvasPixmap from the image <em>image</em>.<h3 class=fn><a name="QCanvasPixmap-3"></a>QCanvasPixmap::QCanvasPixmap ( const <a href="qpixmap.html">QPixmap</a> & pm, const <a href="qpoint.html">QPoint</a> & offset )</h3>Constructs a QCanvasPixmap from the pixmap <em>pm</em> using the offset <em>offset</em>.<h3 class=fn><a name="~QCanvasPixmap"></a>QCanvasPixmap::~QCanvasPixmap ()</h3>Destroys the pixmap.<h3 class=fn>int <a name="offsetX"></a>QCanvasPixmap::offsetX () const</h3><p> Returns the x-offset of the pixmap's hotspot.<p> <p>See also <a href="#setOffset">setOffset</a>().<h3 class=fn>int <a name="offsetY"></a>QCanvasPixmap::offsetY () const</h3><p> Returns the y-offset of the pixmap's hotspot.<p> <p>See also <a href="#setOffset">setOffset</a>().<h3 class=fn>void <a name="setOffset"></a>QCanvasPixmap::setOffset ( int x, int y )</h3><p> Sets the offset of the pixmap's hotspot to (<em>x</em>, <em>y</em>).<p> <b>Warning:</b> Do not call this function if any QCanvasSprites arecurrently showing this pixmap.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -