Kirix Support Forums

Use wxWebConnect to render page offscreen

Please post all general questions, comments, bug reports, and any other wxWebConnect feedback here.

Use wxWebConnect to render page offscreen

Postby jerry_mouse on Sat Jan 09, 2010 5:23 am

Hi all,
This wxWebConnect is really an exciting extension to wxWidgets users. Hope we can catch up with qt-webkit in the future.
I have tried to build and run the testapp and everything seems to work really well.
I'm now trying to find a way to render a page in the background and get the result as image data.
Does anyone have done this before or have any experience with this to share?
Can I do this with current wxWebConnect code?

Your comments are very appreciated.
Thank you very much!
jerry_mouse
Registered User
 
Posts: 12
Joined: Sat Jan 09, 2010 5:11 am

Re: Use wxWebConnect to render page offscreen

Postby Aaron on Sat Jan 09, 2010 3:02 pm

I'm also very interested in this capability. Although I haven't succeeded in getting it to work, it's possible.

Originally, I wanted to capture the image of any control, such as a button. So I tried accessing the device context of the control and transferring it to a memory device context. However, this approach failed when the control wasn't showing, and as a result, it required the control to momentarily show before the image could be captured.

I also looked into other approaches that were more specific to the browser control, and I found a Firefox add-on called Fireshot that let's you take screenshots of webpages, including both the visible and offscreen, invisible portions.

So, at some level, it's possible to render portions of the page that are offscreen, and we just need to find out what interfaces are required in order to accomplish the same thing in the wxWebConnect library.

If you are willing, please research this. I would very much like to have this capability.
Aaron Williams
Kirix Support Team
User avatar
Aaron
Kirix Support Team
 
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Re: Use wxWebConnect to render page offscreen

Postby jerry_mouse on Thu Jan 14, 2010 3:58 am

Hi Aaron,
I've dug into the source code of Fireshot but it seems that they write their offscreen rendering routines in a .dll, so got no luck there.
I then found OffscreenGecko from sf.net
http://sourceforge.net/projects/offscreengecko
I built and tested with prebuilt xulrunner 1.9.1.4 sdk from Mozilla and it works really well.
And now I'm digging through its source code and see if it can be integrated into wxWebConnect or not.

Hope this can help.
Regards,
jerry_mouse
Registered User
 
Posts: 12
Joined: Sat Jan 09, 2010 5:11 am

Re: Use wxWebConnect to render page offscreen

Postby Aaron on Mon Jan 18, 2010 1:11 pm

This looks very interesting. Have you made any progress on this? Alternatively, is there any possibility we can learn what needs to be done and simply implement equivalent functionality?
Aaron Williams
Kirix Support Team
User avatar
Aaron
Kirix Support Team
 
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Re: Use wxWebConnect to render page offscreen

Postby dxj19831029 on Mon Mar 22, 2010 11:24 pm

Hey,

Do you guys have any solution?

I would like to use wxWebConnect, but the thumbnail image is a must.

So I would like to see if you guys have any progress yet?

Cheers
dxj19831029
Registered User
 
Posts: 1
Joined: Mon Mar 22, 2010 11:22 pm

Re: Use wxWebConnect to render page offscreen

Postby jerry_mouse on Fri Apr 16, 2010 12:37 am

After digging enough with all the related source codes out there.
I come up with this:
1. Create an offscreen chrome (container) that listens to web progress to let us know when the page is loaded completely.
2. Use nsIDOMCanvasRenderingContext2D::DrawWindow to draw the dom window on to our own canvas and extract the pixel bits in RBGA.

The result is quite good, except that it won't render plug-ins like flash...
In my case, I just need it to render html text so this is not important now.
jerry_mouse
Registered User
 
Posts: 12
Joined: Sat Jan 09, 2010 5:11 am

Return to wxWebConnect Questions, Thoughts & Feedback