Displaying HTML img src on Canvas?

Hi all!

Is it possible to get the picture displayed from a website on a HTMLViewer on a Canvas?
This is in order to Display the picture of a Captcha on a Canvas Picture

Regards
:smiley:

MBS plugins can I believe.
But at this point, you really, really need to ask the website owner for an API.

[quote=348042:@Tim Parnell]MBS plugins can I believe.
But at this point, you really, really need to ask the website owner for an API.[/quote]

Maybe, cuz ChromiumBrowserMBS.Image its Windows only, It doesn’t run on Mac or Linux :frowning:

You can use HTMLViewer.mainFrameMBS.dataSource.data to get the HTML source of the page and parse the image source from there.

Then you can download the image into memory and display it on a canvas.

[quote=348065:@Jared Feder]You can use HTMLViewer.mainFrameMBS.dataSource.data to get the HTML source of the page and parse the image source from there.

Then you can download the image into memory and display it on a canvas.[/quote]
In fact I have the URL of the Captcha, I get it easily doing this:

Dim JsPicString As String = "document.getElementById('datosCreditoForm:captcha').src;"
Msgbox HTMLViewer1.EvaluateJavaScriptMBS(JsPicString)

But I dunno how to put the Image on the Canvas, knowing the URL. :frowning:

If the URL doesn’t redirect, then you can do something like this:

dim hSock as new HTTPSecureSocket dim mb as MemoryBlock = hSock.Get("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png",10) dim p as Picture = Picture.FromData(mb)

[quote=348091:@Jared Feder]If the URL doesn’t redirect, then you can do something like this:

dim hSock as new HTTPSecureSocket dim mb as MemoryBlock = hSock.Get("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png",10) dim p as Picture = Picture.FromData(mb)[/quote]
Perfect, you’re a genius.
I test it and it works, unfortunately for me It doesn’t work with my URL, despite of when I paste that URL on a browser shows me the captcha picture. It might have something weird that do that trick. :smiley:

Sometimes CAPTCHA is designed so that loading the image url changes the CAPTCHA, so it may be properly doing it’s job of keeping you out.

Yeah its an awesome mechanism, even when the URL its identical, everytime when you reload the URL a different picture shows everytime.

I am confused whether you want to render htmlviewer content or just get a picture shown there?

OP wanted to grab an image tag’s source file and display it in a canvas. I thought that maybe MBS HTML Viewer plugins had a way to grab the source code of the page. I left out all the other steps involved because I’m not helping someone circumvent deliberate anti-automation tools.