<HTML> <HEAD> <TITLE>class KPixmapSplitter</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>class KPixmapSplitter</h1> </TD> <TD valign="top" align="right" colspan="1"> If you have a pixmap containing several items (icons), you can use this class to get the coordinates of each item. <small><A HREF="#longdesc">More...</A></small></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> <TR><TH>Definition</TH><TD><code>#include <<A HREF="kpixmapsplitter_h.html">kpixmapsplitter.h</A>></code></TD></TR> <TR><TH><A HREF="full-list-KPixmapSplitter.html">List of all Methods</A></TH></TR> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <h4>Public Methods</h4><ul><LI> <b><A HREF="#ref1">KPixmapSplitter</A></b> () </LI> <LI> <b><A HREF="#ref2">~KPixmapSplitter</A></b> () </LI> <LI>void <b><A HREF="#ref3">setPixmap</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& pixmap ) </LI> <LI>const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& <b><A HREF="#ref4">pixmap</A></b> () const </LI> <LI>void <b><A HREF="#ref5">setItemSize</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qsize.html">QSize</A>& size ) </LI> <LI><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qsize.html">QSize</A> <b><A HREF="#ref6">itemSize</A></b> () const </LI> <LI>void <b><A HREF="#ref7">setVSpacing</A></b> ( int spacing ) </LI> <LI>void <b><A HREF="#ref8">setHSpacing</A></b> ( int spacing ) </LI> <LI><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qrect.html">QRect</A> <b><A HREF="#ref9">coordinates</A></b> ( int pos ) </LI> <LI><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qrect.html">QRect</A> <b><A HREF="#ref10">coordinates</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qchar.html">QChar</A>& ch ) </LI> </ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p> If you have a pixmap containing several items (icons), you can use this class to get the coordinates of each item. </p> <p> For example, if you have a pixmap with 25 items and you want to get the 4th item as a pixmap (every item being 20x10 pixels): </p><table border="0" width="100%"> <tr> <td bgcolor="#BEEAE0"> <pre> <A HREF="KPixmapSplitter.html#KPixmapSplitter">KPixmapSplitter</A> splitter; splitter.<A HREF="KPixmapSplitter.html#setPixmap">setPixmap</A>( somePixmap ); splitter.<A HREF="KPixmapSplitter.html#setItemSize">setItemSize</A>( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qsize.html">QSize</A>( 20, 10 )); <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A> item( 20, 10 ); item.fill( Qt::white ); <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qrect.html">QRect</A> rect = splitter.<A HREF="KPixmapSplitter.html#coordinates">coordinates</A>( 4 ); if ( !rect.isEmpty() ) bitBlt( &item, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpoint.html">QPoint</A>(0,0), &somePixmap, rect, CopyROP ); @short A class to split a <A HREF="KPixmapSplitter.html#pixmap">pixmap</A> into several items. @author Carsten Pfeiffer <pfeiffer@kde.org> </pre> </td></tr> </table> <p> </p> <A NAME="KPixmapSplitter"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>KPixmapSplitter</strong> () <br></td><td align="right"><h3><strong>KPixmapSplitter</strong></h3></td></tr></table><p></p><p> Constructor, does nothing but initializing some default-values. </p> <A NAME="~KPixmapSplitter"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~KPixmapSplitter</strong> () <br></td><td align="right"><h3><strong>~KPixmapSplitter</strong></h3></td></tr></table><p></p><A NAME="setPixmap"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>setPixmap</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& pixmap ) <br></td><td align="right"><h3><strong>setPixmap</strong></h3></td></tr></table><p></p><p> Set the pixmap to be splitted. </p> <A NAME="pixmap"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td>const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& <strong>pixmap</strong> () <br></td><td align="right"><h3><strong>pixmap</strong></h3></td></tr></table><p> <small>[const]</small></p><p> </p> <p><b>Returns</b>: the pixmap that has been set via <A HREF="KPixmapSplitter.html#setPixmap">setPixmap</A>(). </p> <A NAME="setItemSize"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>setItemSize</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qsize.html">QSize</A>& size ) <br></td><td align="right"><h3><strong>setItemSize</strong></h3></td></tr></table><p></p><p> Set the size of the items you want to get out of the given pixmap. The QRect of coordinate will have the width and height of exactly this <code>size</code>. </p> <A NAME="itemSize"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qsize.html">QSize</A> <strong>itemSize</strong> () <br></td><td align="right"><h3><strong>itemSize</strong></h3></td></tr></table><p> <small>[const]</small></p><p> </p> <p><b>Returns</b>: the set size of the items (coordinates) you want to get out of the given pixmap. </p> <A NAME="setVSpacing"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>setVSpacing</strong> ( int spacing ) <br></td><td align="right"><h3><strong>setVSpacing</strong></h3></td></tr></table><p></p><p> If there is space between rows in the given pixmap, you have to specify how many pixels there are. </p> <A NAME="setHSpacing"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>setHSpacing</strong> ( int spacing ) <br></td><td align="right"><h3><strong>setHSpacing</strong></h3></td></tr></table><p></p><p> If there is space between columns in the given pixmap, you have to specify how many pixels there are. </p> <A NAME="coordinates"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qrect.html">QRect</A> <strong>coordinates</strong> ( int pos ) <br></td><td align="right"><h3><strong>coordinates</strong></h3></td></tr></table><p></p><p> </p> <p><b>Returns</b>: the coordinates of the item at position pos in the given pixmap. </p> <A NAME="coordinates"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qrect.html">QRect</A> <strong>coordinates</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qchar.html">QChar</A>& ch ) <br></td><td align="right"><h3><strong>coordinates</strong></h3></td></tr></table><p></p><p> Overloaded for convenience. Returns the item at the position of the given character (when using a latin1 font-pixmap) </p> <HR> <table> <tr><td><small>Generated by: qateam on updates.mandrakesoft.com on Mon Dec 30 16:08:56 2002, using kdoc 2.0a53.</small></td></tr> </table> </BODY> </HTML>