Back in may I posted about a way to get basic webcam support in Silverlight by integrating Flash. The post got some good feedback, and lately I’ve gotten a few requests to update the application for Silverlight 2 Beta 2. I have now done that, as well as adding a new sample application using the webcam support for something (somewhat) useful.

The new example application is called “Webcam Sliding Puzzle” and extends a picture puzzle game written by Cigdem Patlak and adds support for capturing pictures from your local webcam. The original game supported reading images from your local computer using the open file dialog in Silverlight, so adding support for webcam images was fairly straight forward. Click the screenshot to try out the game.

Webcam Sliding Puzzle

If you want to learn how to add webcam support in Silverlight I recommend checking out my older post “Webcam in Silverlight 2 - MacGyver style!” For more details on integrating Silverlight and Flash check out the article “Silverlight and Flash Interoperability using HTML Bridge and ExternalInterface API” I wrote for www.silverlightshow.net.

Thursday, September 04, 2008 6:49:58 PM (AUS Eastern Standard Time, UTC+10:00)
Hi I was trying on your project.

I just installed a Logitech QuickCam.

After clicking the Start webcam,

error occur on

string base64Image = (string)HtmlPage.Window.Invoke("takeSnapshot");

the error message are : Failed to Invoke: takeSnapshot.

Could you give me some guidance about this

thanks
Tommy
Thursday, September 04, 2008 9:34:35 PM (AUS Eastern Standard Time, UTC+10:00)
Hmm...

Does the browser show the Flash element, and does it show your webcam? You must click "allow" before you can start capturing frames. Which browser are you using?
Thursday, September 04, 2008 10:11:37 PM (AUS Eastern Standard Time, UTC+10:00)
Hi Jonas,

I'm using IE7

The entire website when I run from vs2008 shows only the SilverLight element.

I tried both WebcamPOC Silverlight 2 Beta 1 and WebcamPOC Silverlight 2 Beta 2 but error trigger on the same code which is

string base64Image = (string)HtmlPage.Window.Invoke("takeSnapshot");

I tried upload the file to my web host and the flash element do appear.
But when I click the "start" button, only the fps is running and the screen change to white.

http://www.gauz.sg/webcamPOC_compiled/WebcamPOC.html

Thanks for your reply
Tommy
Thursday, September 04, 2008 11:24:11 PM (AUS Eastern Standard Time, UTC+10:00)
Hi Jonas,

I manage to solve the error trigger but still I couldn't view my webcam after I have click the Start button. The frame per second is going up and down though..
Tommy
Monday, September 08, 2008 10:35:19 AM (AUS Eastern Standard Time, UTC+10:00)
Hmm...

I tried accessing the version you compiled and uploaded to gauz.sg, and it works just fine on my computer with the XBOX360 Live Camera...

Does your webcam work fine in other applications, like MSN Messenger or Skype? Have you tried "pure" flash sites that use the web camera? Try accessing this site http://www.gskinner.com/blog/archives/2005/08/flash_8_webcam.html and see if it works. It's a flash-only site that uses the webcam. If that one doesn't work the problem is with your webcam and Flash, and not with the Silverlight integration...

- Jonas
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
www.flickr.com
This is a Flickr badge showing public photos from follesoe. Make your own badge here.