.TH "KPixmapSplitter" 3 "28 Jan 2004" "kdefx Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPixmapSplitter \- 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.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpixmapsplitter.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPixmapSplitter\fP ()"
.br
.RI "\fIConstructor, does nothing but initializing some default-values. \fP"
.ti -1c
.RI "void \fBsetPixmap\fP (const  \fBQPixmap\fP &pixmap)"
.br
.RI "\fISets the pixmap to be splitted. \fP"
.ti -1c
.RI "const  \fBQPixmap\fP & \fBpixmap\fP () const "
.br
.ti -1c
.RI "void \fBsetItemSize\fP (const  \fBQSize\fP &size)"
.br
.RI "\fISets the size of the items you want to get out of the given pixmap. \fP"
.ti -1c
.RI "\fBQSize\fP \fBitemSize\fP () const "
.br
.ti -1c
.RI "void \fBsetVSpacing\fP (int spacing)"
.br
.RI "\fIIf there is space between rows in the given pixmap, you have to specify how many pixels there are. \fP"
.ti -1c
.RI "void \fBsetHSpacing\fP (int spacing)"
.br
.RI "\fIIf there is space between columns in the given pixmap, you have to specify how many pixels there are. \fP"
.ti -1c
.RI "\fBQRect\fP \fBcoordinates\fP (int pos)"
.br
.ti -1c
.RI "\fBQRect\fP \fBcoordinates\fP (const  \fBQChar\fP &ch)"
.br
.RI "\fIOverloaded for convenience. \fP"
.in -1c
.SH "Detailed Description"
.PP 
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): 
.PP
.nf

 KPixmapSplitter splitter;
 splitter.setPixmap( somePixmap );
 splitter.setItemSize( QSize( 20, 10 ));
.PP
.PP
.PP
.nf
 \fBQPixmap\fP item( 20, 10 );
 item.fill( Qt::white );
 \fBQRect\fP rect = splitter.coordinates( 4 );
 if ( !rect.isEmpty() )
     bitBlt( &item, QPoint(0,0), &somePixmap, rect, CopyROP );
 
.PP
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 50 of file kpixmapsplitter.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPixmapSplitter::KPixmapSplitter ()"
.PP
Constructor, does nothing but initializing some default-values. Definition at line 22 of file kpixmapsplitter.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KPixmapSplitter::setPixmap (const \fBQPixmap\fP & pixmap)"
.PP
Sets the pixmap to be splitted. Definition at line 36 of file kpixmapsplitter.cpp.
.SS "const \fBQPixmap\fP& KPixmapSplitter::pixmap () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the pixmap that has been set via \fBsetPixmap\fP(). 
.RE
.PP
Definition at line 67 of file kpixmapsplitter.h.
.SS "void KPixmapSplitter::setItemSize (const \fBQSize\fP & size)"
.PP
Sets the size of the items you want to get out of the given pixmap. The \fBQRect\fP of \fBcoordinates(int)\fP will have the width and height of exactly this \fCsize\fP. Definition at line 42 of file kpixmapsplitter.cpp.
.SS "\fBQSize\fP KPixmapSplitter::itemSize () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the set size of the items (coordinates) you want to get out of the given pixmap. 
.RE
.PP
Definition at line 80 of file kpixmapsplitter.h.
.SS "void KPixmapSplitter::setVSpacing (int spacing)"
.PP
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.
.SS "void KPixmapSplitter::setHSpacing (int spacing)"
.PP
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.
.SS "\fBQRect\fP KPixmapSplitter::coordinates (int pos)"
.PP
\fBReturns:\fP
.RS 4
the coordinates of the item at position pos in the given pixmap. 
.RE
.PP
Definition at line 67 of file kpixmapsplitter.cpp.
.PP
References QSize::height(), QPixmap::height(), QPixmap::isNull(), QSize::width(), and QPixmap::width().
.PP
Referenced by coordinates().
.SS "\fBQRect\fP KPixmapSplitter::coordinates (const \fBQChar\fP & ch)"
.PP
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.
.PP
References coordinates(), and QChar::latin1().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdefx Library from the source code.
