Image in QML is not transparent
Hi,
I am drawing transparent image in the page but for some reason it is not visible as transparent, can any body point me the reason?
Please see the + - back and reset button. See the image
[IMG]http://www.freeimagehosting.net/6qblq[/IMG]
[url]http://www.freeimagehosting.net/6qblq[/url]
Thanks
Akatar
Re: Image in QML is not transparent
Are you sure about the fact that the image itself is transparent.Try opening the image in paint etc with a black background & see if white background of image is still visible.
Re: Image in QML is not transparent
[QUOTE=vineet.jain;909834]Are you sure about the fact that the image itself is transparent.Try opening the image in paint etc with a black background & see if white background of image is still visible.[/QUOTE]
I am not 100% sure about the image. But with gimp 2.6 it looks the image is transparent.
RHS is taken from gimp editor and LHS is windows paint. Is it not transparent? See the image from here [url]http://hemelix.com/imagecompare.png[/url] or [IMG]http://hemelix.com/imagecompare.png[/IMG]
Re: Image in QML is not transparent
I think same issue is discussed here with a solution as well : [url]http://comments.gmane.org/gmane.comp.lib.qt.general/43188[/url]
Re: Image in QML is not transparent
[QUOTE=vineet.jain;909834]Are you sure about the fact that the image itself is transparent.Try opening the image in paint etc with a black background & see if white background of image is still visible.[/QUOTE]
Thanks but it did not help me. It is qml app that load qml file and I use the png file
I have a code like this
QScopedPointer<QApplication> app(createApplication(argc, argv));
//QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
QmlApplicationViewer viewer;
viewer.setAttribute(Qt::WA_OpaquePaintEvent);
viewer.setAttribute(Qt::WA_NoSystemBackground);
viewer.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
viewer.viewport()->setAttribute(Qt::WA_NoSystemBackground);
//viewer.setStyleSheet("background:transparent;");
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
Re: Image in QML is not transparent
Make sure that the rectangle behind your image is transparent, by default it is white
br
Mahbub