HTML Viewer Native vs Webkit

When using “native” browser in xojo I’m able to get a snapshot of the HTMLViewer but…the native browser is showing up at IE7 My question is… is there a way to upgrade the xojo browser to the latest IE? I don’t want to use webkit as it seems it can’t be used to create a “snapshot” https://forum.xojo.com/8025-htmlviewer-image-to-canvas-question/0 because it renders a blank white square. I need a modern browser to display the html correctly.

Only the user can accept Windows Updates and get the new IE.

The MBS plugins have some additional methods on the HTMLViewer classes. You may look into that.

That’s a screenshot of mine :slight_smile: and I’m on windows 7 and have IE10 installed.

Its probably running in compatibility mode
http://www.realsoftwareblog.com/2011/01/changing-htmlviewer-rendering-mode-on.html

Thanks Norman… That post was back in 2011? Is there an update tutorial on how to use the most up to date browser… IE10 or 11? Is there something programmatically that will do this for the user or will all potential users have to do this “hack” if we want to use Native Browser with our Xojo apps?

If you read that thread correctly, you will notice a post from Matthew Combatti for Windows to get the picture from the HTMLViewer, and another from Jerry AB which addresses both Windows and Mac OS X.

So you can use WebKit and still be able to get a picture of HTMLViewer. Maybe simpler than trying to update the default browser from within your program…

[quote=94125:@Rob Vanarsdall]Thanks Norman… That post was back in 2011? Is there an update tutorial on how to use the most up to date browser… IE10 or 11?
[/quote]
Yeah that article still applies as far as I know

You could write the key programmatically BUT a user may not have privileges to add keys to the registry
From what I understand this is how MS set up the browser & associated activeX control to be “most compatible”

Or just use WebKit which doesn’t behave this way

I’d like to apologize here in advance for limited knowledge in xojo and wanted to thank everyone that has helped me thus far - I guess I’m not following how to get webkit and Matt’s code that he has supplied to work on windows. I get a white canvas. Now his code works fine… If I choose native htmlviewer: (Matt’s code that I’m using).

The photo below is Windows - Webkit HTMLviewer - Canvas - Matt’s Code.

If you could will you click on the date link to the comment you’re referencing that Jerry AB used in order to get the webkit to work in windows and post that link below? As I think webkit is the way to go.

Here’s a link of the xojo project: Xojo Html to Canvas So you can see what I’m talking about. Run on windows if you choose to download.

You are right, Matt code does not work when Webkit is used. BitBlt should work, but I do not have time to debug Matt code at this time. A quick workaround is to overlay a canvas on top of HTMLViewer and pass it to ControlSnapShot instead.

What you do is position the Canvas exactly over the HTMLViewer area, or just over the picture area (to avoid the scrollbars), make it invisible in the inspector, and render it visible just before calling ControlSnapShot, then back to invisible.

I quickly tested that and it works fine.

No need for bitblt.
you can use ChromiumBrowserMBS.Image(width as integer, height as integer) as Picture method in our plugins :slight_smile:

If you already own the MBS plugin part for that, then it’s the way to go. Otherwise, bitblt is slightly cheaper and dead simple. Either use the canvas workaround that Michal posted (genius!) or grab the entire window and cut out the part you’re interested in.

Edit: that sounded too anti-MBS. The plugin will do a whole lot more for you than just grab a browser image. You’d do well to review what it can do. It could come in handy.