I have some textfields processed and other elements, but I want to get the bitmap so I can save it somewhere on disk. I need to do it directly from WatiN if this is possible.
How can I do this?
I have some textfields processed and other elements, but I want to get the bitmap so I can save it somewhere on disk. I need to do it directly from WatiN if this is possible.
How can I do this?
I don't think you can get the binary information directly from WatiN. However you have
Image.Uri
method give you the URI of the image. So then it is easy to download it wih http request.Hope this helps
I had such problem, and I could not solve it. PHP generated new images all the time so I used the
CaptureWebPageToFile()
method.That's the Method i use for php generated images. It's implimented in my own WebBrowserClass, which extends the webbrowser control.
(so "this" = WebBrowser)
But we have to import the IHTMLElementRender2 interface, to use the method.
I found this method in web, about 1 year ago, so if you search for it you might find more information.
Iwan
I had a similar problem some time ago. Watin can't do this directly but it exposes the mshtml objects needed to get some results.
At the time my code was pretty much like this:
This little hack, basically, tries to copy the image to the clipboard. However I had a couple of problems making it work properly and ended up snapshoting the region around the image and saving it to disk.
Although this may not be very helpful it may point you in some directions..
A while ago I needed to extract image data too so I came with this solution:
Create an hidden field and a canvas inside the page using
transform it to base64 using javascript and retrieving its value
then retrieving the codified value
Hope it helps :)