• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdefx
 

tdefx

Public Member Functions | List of all members
KPixmapSplitter Class Reference

#include <kpixmapsplitter.h>

Public Member Functions

 KPixmapSplitter ()
 
void setPixmap (const TQPixmap &pixmap)
 
const TQPixmap & pixmap () const
 
void setItemSize (const TQSize &size)
 
TQSize itemSize () const
 
void setVSpacing (int spacing)
 
void setHSpacing (int spacing)
 
TQRect coordinates (int pos)
 
TQRect coordinates (const TQChar &ch)
 

Detailed Description

A class to split a pixmap into several items.

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( TQSize( 20, 10 ));
TQPixmap item( 20, 10 );
item.fill( TQt::white );
TQRect rect = splitter.coordinates( 4 );
if ( !rect.isEmpty() )
bitBlt( &item, TQPoint(0,0), &somePixmap, rect, CopyROP );
KPixmapSplitter
A class to split a pixmap into several items.
Definition: kpixmapsplitter.h:54
KPixmapSplitter::setPixmap
void setPixmap(const TQPixmap &pixmap)
Sets the pixmap to be split.
Definition: kpixmapsplitter.cpp:36
KPixmapSplitter::coordinates
TQRect coordinates(int pos)
Definition: kpixmapsplitter.cpp:67
KPixmapSplitter::setItemSize
void setItemSize(const TQSize &size)
Sets the size of the items you want to get out of the given pixmap.
Definition: kpixmapsplitter.cpp:42
Author
Carsten Pfeiffer pfeif.nosp@m.fer@.nosp@m.kde.o.nosp@m.rg

Definition at line 53 of file kpixmapsplitter.h.

Constructor & Destructor Documentation

◆ KPixmapSplitter()

KPixmapSplitter::KPixmapSplitter ( )

Constructor, does nothing but initialize some default-values.

Definition at line 22 of file kpixmapsplitter.cpp.

◆ ~KPixmapSplitter()

KPixmapSplitter::~KPixmapSplitter ( )

Definition at line 32 of file kpixmapsplitter.cpp.

Member Function Documentation

◆ coordinates() [1/2]

TQRect KPixmapSplitter::coordinates ( const TQChar &  ch)

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.

◆ coordinates() [2/2]

TQRect KPixmapSplitter::coordinates ( int  pos)
Returns
the coordinates of the item at position pos in the given pixmap.

Definition at line 67 of file kpixmapsplitter.cpp.

◆ itemSize()

TQSize KPixmapSplitter::itemSize ( ) const
inline
Returns
the set size of the items (coordinates) you want to get out of the given pixmap.

Definition at line 83 of file kpixmapsplitter.h.

◆ pixmap()

const TQPixmap & KPixmapSplitter::pixmap ( ) const
inline
Returns
the pixmap that has been set via setPixmap().

Definition at line 70 of file kpixmapsplitter.h.

◆ setHSpacing()

void KPixmapSplitter::setHSpacing ( int  spacing)

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.

◆ setItemSize()

void KPixmapSplitter::setItemSize ( const TQSize &  size)

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

The TQRect of coordinates(int) will have the width and height of exactly this size.

Definition at line 42 of file kpixmapsplitter.cpp.

◆ setPixmap()

void KPixmapSplitter::setPixmap ( const TQPixmap &  pixmap)

Sets the pixmap to be split.

Definition at line 36 of file kpixmapsplitter.cpp.

◆ setVSpacing()

void KPixmapSplitter::setVSpacing ( int  spacing)

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.


The documentation for this class was generated from the following files:
  • kpixmapsplitter.h
  • kpixmapsplitter.cpp

tdefx

Skip menu "tdefx"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdefx

Skip menu "tdefx"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdefx by doxygen 1.9.4
This website is maintained by Timothy Pearson.