lst.append( scaleColor( i, 0, num - 1 ) );
}
+/*!
+ \brief Scale the pixmap to the required size.
+
+ If \h is 0 (default) the value of \a w is used instead (to create
+ square pixmap).
+
+ \param icon pixmap to be resized
+ \param w required pixmap width
+ \param h required pixmap height
+ \return scaled pixmap
+*/
+QPixmap Qtx::scaleIcon( const QPixmap& icon, const unsigned w, const unsigned h )
+{
+ QPixmap p;
+ int aw = w, ah = h <= 0 ? w : h;
+ if ( p.isNull() || aw <= 0 || ah <= 0 || aw == icon.width() && ah == icon.height() )
+ p = icon;
+ else
+ p = icon.fromImage( icon.toImage().scaled( aw, ah, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
+ return p;
+}
+
/*!
\brief Convert given image to the grayscale format.
\param img initial image
static QColor scaleColor( const int, const int, const int );
static void scaleColors( const int, QColorList& );
+ static QPixmap scaleIcon( const QPixmap&, const unsigned, const unsigned = 0 );
static QImage grayscale( const QImage& );
static QPixmap grayscale( const QPixmap& );
static QImage transparentImage( const int, const int, const int = -1 );