QPixmap||QMainWindow problem
-
I'm trying to set background to my window. i have an png image with alpha channel. When i'm scaling image to fit in size of my window only mask of this image is scaled, image - not.
link text --- imageMainWindow::MainWindow(QApplication *app,QWidget *parent) : QMainWindow(parent),ui(new Ui::MainWindow) { this->app = app; ui->setupUi(this); setWindowFlags( Qt::FramelessWindowHint ); QPixmap bkgnd(":/launcher_body.png"); qDebug() << bkgnd.size(); bkgnd = bkgnd.scaled(this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); qDebug() << bkgnd.size(); QPalette palette; palette.setBrush(QPalette::Background, bkgnd); this->setPalette(palette); this->setMask(bkgnd.mask()); } ```)
-
Hi
Its strange
I tried your code here and it does scale the actual image to the size of
the mainwindow. -
@EpicLoyd
i wondered that too but png is png.
but fast to test
https://www.dropbox.com/s/xflsnfngw8wjlx0/Untitled-1.png?dl=0
as mine didThe code shown is the full version yes?
U do nothing else with the image? -
@mrjj umm http://prntscr.com/9j0tbe probably this is mask. Actual image aligned and we can't see it
http://prntscr.com/9j0tm1
no, i did nothing
uh oh
"libpng warning: iCCP: known incorrect sRGB profile" -
@EpicLoyd
Ok it does different on your platform.
it should be red.
Im on win 7.
what is your platform?
update:
you use another theme than me.
I wonder if picture is really shown ?
It seems just to be mask.-"libpng warning: iCCP: known incorrect sRGB profile"
yeah, it seems the png plugin dont like photoshops normal color profile.
Its from within libpng. still shows correctly.