Hi All,
I have tried to modify the PluginView::paint method in PluginViewQt.cpp to dump
the flash content. But the result is always a gray image. Does any one know
why? Or has anyone implemented the similar function before?
I have also tested the "print/print preview" function on many browsers
(Firefox, Konqueror, arora, Opera). None of them can print flash content. Is
there any way to implement it?
Thanks a lot.
PS: There may be a bug of PluginView::paint in PuginViewWin.cpp.While dumping
web page with flash content into image, the dumped flash content has a doubled
offset. It works well if we comment the "SetWorldTransform" lines in
PluginView::paintWindowedPluginIntoContext.
Here are the codes of my PluginView::paint in PluginViewQt.cpp. It always
outputs a gray image in Linux.
-------------------------------------------------------------------------------------------------------------------
void PluginView::paint(GraphicsContext* context, const IntRect& rect)
{
if (!m_isStarted) {
paintMissingPluginIcon(context, rect);
return;
}
//if (m_isWindowed || context->paintingDisabled())
// return;
//notImplemented();
if(context->paintingDisabled()) return;
PlatformGraphicsContext *painter = context->platformContext();
if(painter){
PlatformPluginWidget widget = platformPluginWidget();
if(widget){
//QPixmap pixmap = QPixmap::grabWidget(widget);
//QPixmap pixmap = QPixmap::grabWindow(widget->winId());
//QPixmap pixmap = QPixmap::grabWindow((WId)m_npWindow.window);
//widget->render(painter, QPoint(widget->x(),widget->y()),
QRegion(0,0,widget->width(),widget->height()),
//QWidget::DrawWindowBackground | QWidget::DrawChildren |
QWidget::IgnoreMask );
QPixmap pixmap(widget->size());
widget->render(&pixmap);
pixmap.save("/tmp/test.ppm");
painter->drawPixmap(QPoint(widget->x(),widget->y()), pixmap);
}
}
}
_________________________________________________________________
Messenger10年嘉年华,礼品大奖等你拿!
http://10.msn.com.cn_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev