{
// Load the QImage directly from the resource. No need to create a QPixmap first
QImage tmp
( ":/Images/PlayerMoveDownStill.png",
"PNG" );
for(int i=0;i<tmp.height();i++)
{
for(int k=0;k<tmp.width();k++)
{
QColor color
( tmp.
pixel( k, i
) );
// changed this from pixelColor() to ensure alpha is copied if ( color.alpha() != 0 ) // modify only the pixels with non-zero alpha
{
color.setRgb(color.red()*0.5,color.blue()*0.5,color.green()*0.5, color.alpha() );
tmp.setPixelColor(k,i,color);
}
}
}
// Now, convert the image to a pixmap and set it on the graphics object
setPixmap( t );
setPos(game->width()/2-this->boundingRect().width()/2,game->height()/2-this->boundingRect().height()/2);
}