KPixmapSplitter Class Reference
If you have a pixmap containing several items (icons), you can use this class to get the coordinates of each item. A class to split a pixmap into several items. More...
#include <kpixmapsplitter.h>
Public Member Functions | |
KPixmapSplitter () | |
Constructor, does nothing but initializing some default-values. | |
void | setPixmap (const QPixmap &pixmap) |
Sets the pixmap to be splitted. | |
const QPixmap & | pixmap () const |
void | setItemSize (const QSize &size) |
Sets the size of the items you want to get out of the given pixmap. | |
QSize | itemSize () const |
void | setVSpacing (int spacing) |
If there is space between rows in the given pixmap, you have to specify how many pixels there are. | |
void | setHSpacing (int spacing) |
If there is space between columns in the given pixmap, you have to specify how many pixels there are. | |
QRect | coordinates (int pos) |
QRect | coordinates (const QChar &ch) |
Overloaded for convenience. |
Detailed Description
If you have a pixmap containing several items (icons), you can use this class to get the coordinates of each item. A class to split a pixmap into several items.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 );
- Author:
- Carsten Pfeiffer <pfeiffer@kde.org>
Definition at line 50 of file kpixmapsplitter.h.
Constructor & Destructor Documentation
|
Constructor, does nothing but initializing some default-values.
Definition at line 22 of file kpixmapsplitter.cpp. |
Member Function Documentation
|
Sets the pixmap to be splitted.
Definition at line 36 of file kpixmapsplitter.cpp. |
|
Definition at line 67 of file kpixmapsplitter.h. |
|
Sets the size of the items you want to get out of the given pixmap.
The QRect of coordinates(int) will have the width and height of exactly this Definition at line 42 of file kpixmapsplitter.cpp. |
|
Definition at line 80 of file kpixmapsplitter.h. |
|
If there is space between rows in the given pixmap, you have to specify how many pixels there are.
Definition at line 50 of file kpixmapsplitter.cpp. |
|
If there is space between columns in the given pixmap, you have to specify how many pixels there are.
Definition at line 58 of file kpixmapsplitter.cpp. |
|
Definition at line 67 of file kpixmapsplitter.cpp. References QSize::height(), QPixmap::height(), QPixmap::isNull(), QSize::width(), and QPixmap::width(). Referenced by coordinates(). |
|
Overloaded for convenience. Returns the item at the position of the given character (when using a latin1 font-pixmap) Definition at line 91 of file kpixmapsplitter.cpp. References coordinates(), and QChar::latin1(). |
The documentation for this class was generated from the following files: