knorv
knorv

Reputation: 50117

How do I take a webcam snapshot picture in Flex?

Using Flex, what is the recommended way of taking a webcam snapshot picture?

Something along the lines of:

var camera:Camera = Camera.getCamera();
var image:Image = /* magic goes here */

Upvotes: 1

Views: 1779

Answers (2)

Yada
Yada

Reputation: 31225

I needed to solve this problem.

There is a good opensource project you can see.

Userbooth http://www.userbooth.com/

Upvotes: 1

Florian F
Florian F

Reputation: 8875

First, you have to create a Video object in which you attach the camera :

var video:Video = new Video(320,240);
video.attachCamera(camera);
addChild(video);

Then create an instance of a BitmapData with the same size as your video object and draw in it the video object.

var bitmapData:BitmapData = new BitmapData(video.width,video.height);
bitmapData.draw(video);

Upvotes: 2

Related Questions