Question

I'm working on windows form to get a website that content camera video, and then catch the image on this site
I'm using

webbrowser1.DrawToBitMap(bitmap, bitmapRect)

but the image shows all white. Then I try to catch image from another site (ex: google.com), the method work perfectly. So I think this could be because that this method could not catch video. So my question is do we have any ways to catch the video within a website through web browser control?
this the code that I embed the camera video

    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="704" height="592" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
    <param name="src" value="empty.mov">
    <param name="autoplay" value="true">
    <param name="controller" value="false">
    <param name="qtsrc" value="rtsp://<link>">
    <embed src="empty.mov" width="704" height="592" qtsrc="rtsp://<link>" autoplay="true" controller="false" target="myself" pluginspage="http://www.apple.com/quicktime/download/">
</object>
Was it helpful?

Solution

This is happening because the video box inside the page is not rendered by the web-browser but by the quick-time plugin. hence the web-browser has no information of the graphics content on that region. it would draw blank box.

Now the one person who knows everything about all the graphics content on the screen is the Screen itself. so you can try Graphics.CopyFromScreen method. It has some drawbacks though. for once, it would capture everything on screen including task bar and title bar. second it will capture only the visible part of the page. if the page needs scrolling, or you need full-page screenshot then we have a problem.

we could have workarounds though. the taskbar/titlebar can be cropped off by carefully calculating the rectangle area out of the whole screen. similarly the page can be programatically scrolled, recaptured and images joined to full-page view.

as for the actual implementation, i am fairly optimistic about capturing perfectly sized rectangle out of the screen. i can help with code if you ask. try first (tip) . as for the second part of scroll-capture-join, it would be quite tedious i am sure, but achievable.

OTHER TIPS

This page uses Apple's Quick Time ActiveX control for video playback. Most likely, the control uses DirectX and doesn't respond to WM_PRINT message (used by WebBrowser.DrawToBitMap internally). Although I believe the chances of success are low, you could try a couple of other things, specific to WebBrowser (i.e., outside the full screen capture context):

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top