|
|
If you have a pixmap containing several items (icons), you can use this class to get the coordinates of each item.
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):
KPixmapSplitter splitter;
splitter.setPixmap( somePixmap );
splitter.setItemSize( QSize( 20, 10 ));
QPixmap item( 20, 10 );
item.fill( Qt::white );
QRect rect = splitter.coordinates( 4 );
if ( !rect.isEmpty() )
bitBlt( &item, QPoint(0,0), &somePixmap, rect, CopyROP );
@short A class to split a pixmap into several items.
@author Carsten Pfeiffer <pfeiffer@kde.org>
| |
Constructor, does nothing but initializing some default-values.
| void |
Set the pixmap to be splitted.
| const QPixmap& |
[const]
Returns: the pixmap that has been set via setPixmap().
| void |
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 size.
| QSize |
[const]
Returns: the set size of the items (coordinates) you want to get out of the given pixmap.
| void |
If there is space between rows in the given pixmap, you have to specify how many pixels there are.
| void |
If there is space between columns in the given pixmap, you have to specify how many pixels there are.
| QRect |
Returns: the coordinates of the item at position pos in the given pixmap.
| QRect |
Overloaded for convenience. Returns the item at the position of the given character (when using a latin1 font-pixmap)
| Generated by: ssk@tauon.ph.unimelb.EDU.AU on Wed May 23 04:05:18 2001, using kdoc 2.0a35. |