org.kde.koala

Class KPixmapSplitter

public class KPixmapSplitter extends Object implements QtSupport

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 );
 

Author: Carsten Pfeiffer

UNKNOWN: A class to split a pixmap into several items.

Constructor Summary
protected KPixmapSplitter(Class dummy)
KPixmapSplitter()
Constructor, does nothing but initialize some default-values.
Method Summary
QRectcoordinates(int pos)
QRectcoordinates(char ch)
Overloaded for convenience.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QSizeitemSize()
QPixmappixmap()
voidsetHSpacing(int spacing)
If there is space between columns in the given pixmap, you have to specify how many pixels there are.
voidsetItemSize(QSize size)
Sets the size of the items you want to get out of the given pixmap.
voidsetPixmap(QPixmap pixmap)
Sets the pixmap to be split.
voidsetVSpacing(int spacing)
If there is space between rows in the given pixmap, you have to specify how many pixels there are.

Constructor Detail

KPixmapSplitter

protected KPixmapSplitter(Class dummy)

KPixmapSplitter

public KPixmapSplitter()
Constructor, does nothing but initialize some default-values.

UNKNOWN: Constructor, does nothing but initialize some default-values.

Method Detail

coordinates

public QRect coordinates(int pos)

Returns: the coordinates of the item at position pos in the given pixmap.

UNKNOWN:

coordinates

public QRect coordinates(char ch)
Overloaded for convenience. Returns the item at the position of the given character (when using a latin1 font-pixmap)

UNKNOWN: Overloaded for convenience.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

itemSize

public QSize itemSize()

Returns: the set size of the items (coordinates) you want to get out of the given pixmap.

UNKNOWN:

pixmap

public QPixmap pixmap()

Returns: the pixmap that has been set via setPixmap().

UNKNOWN:

setHSpacing

public void setHSpacing(int spacing)
If there is space between columns in the given pixmap, you have to specify how many pixels there are.

UNKNOWN: If there is space between columns in the given pixmap, you have to specify how many pixels there are.

setItemSize

public void setItemSize(QSize size)
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 size.

UNKNOWN: Sets the size of the items you want to get out of the given pixmap.

setPixmap

public void setPixmap(QPixmap pixmap)
Sets the pixmap to be split.

UNKNOWN: Sets the pixmap to be split.

setVSpacing

public void setVSpacing(int spacing)
If there is space between rows in the given pixmap, you have to specify how many pixels there are.

UNKNOWN: If there is space between rows in the given pixmap, you have to specify how many pixels there are.