[webkit-qt] QImage/QPixmaps and flash transparency
jwu at eyereturn.com
Mon Jan 30 11:50:49 PST 2012
I'm writing an application to take a screenshots of a webpage and am using
webkitqt with python bindings.
It works well except for when there is transparent flash. The transparency
doesn't show. (ie: http://www.flashdesignerzone.com/help/transparent.htm)
I'm running on Debian Wheezy and have 4:4.7.3.-5 installed and am using
python bindings (python-qt4 4.9-2).
At first, I thought it was a flash transparency issue but I am able to use
imagemagick's "import" tool to take a screenshot of the X screen. ( For
example, when I run: DISPLAY=:1 import -window root test.jpg ) In that
case, the flash transparency works so what it seems like to me a
Any thoughts or ideas on what I should do? I've been browsing the class
references and don't see anything that sticks out to me that I should try.
Here's some skeleton code:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
image = QImage(webpage.viewportSize(), QImage.Format_ARGB32_Premultiplied)
painter = QPainter(image)
image.save("test2.jpeg", "JPG", quality=50)
screen_cmd = [ "DISPLAY=:1 /usr/bin/import -window root
xvfb_screen = subprocess.Popen(screen_cmd, shell=True)
app = QApplication(sys.argv)
web = QWebView()
webpage = QWebPage()
webpage.connect(webpage, SIGNAL("loadFinished(bool)"), takeScreen)
settings = webpage.settings()
settings.PluginsEnabled = True
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-qt