# \[HELP\] Flash webcam application: problems with resolution of snapshots and flash cam

**URL:** https://forum.kirupa.com/t/help-flash-webcam-application-problems-with-resolution-of-snapshots-and-flash-cam/321746
**Category:** flash
**Created:** [April 29, 2011, 1:43pm UTC](https://forum.kirupa.com/t/help-flash-webcam-application-problems-with-resolution-of-snapshots-and-flash-cam/321746 "2011-04-29T13:43:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![celestale](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@celestale](https://forum.kirupa.com/u/celestale)
#### Post date: [April 29, 2011, 1:43pm UTC](https://forum.kirupa.com/t/help-flash-webcam-application-problems-with-resolution-of-snapshots-and-flash-cam/321746/1 "2011-04-29T13:43:19Z")

</div>

Hi guys, I’m a beginner in Flash AS3 and I want to ask some questions in this community. I have been having some troubles in taking a snapshot using a webcam in my flash application. My webcam flash application is supposed to take a snapshot and save it in mysql server.

I have a small space in my flash application to put the camera so I have set my camera to show up in my flash application at (160,120) resolution size so that the camera preview will not take up much space in my application. I have a button\_takepicture that allows the user to take picture with it and it will be saved in the server. However, the picture is saved at (160,120) resolution, which is a super small picture when I view it in the server.

Is there any way to set the size of the camera showing up in flash but will not affect the resolution of the saved picture? I want my resolution of the saved picture to be 300x400 and the camera box in flash to be a small size but not a 300x400 size because my stage size is only 550x400.

figure 1a.  
 ![](http://forum.kirupa.com/uploads/kirupa/6524/faa8f2758570583b.jpg)  
as u can see in my flash application, the black box is 160x120 in size, it is the size of the camera preview that I want in my flash application. But in my server, the picture resolution size is also 160x120 (I want a 300x400 instead)

figure 1b.  
 ![](http://forum.kirupa.com/uploads/kirupa/6525/e344f55747fe9765.jpg)  
if i set it to a higher resolution, the camera preview will fill up my flash application. (shown as a red box. 300x400 size) (this is not I want because it takes up huge space)

What should I do if I want my camera size in my flash to look like figure 1a but in my snapshot saved picture in server to be a 300x400 size?

Please help.  
Thanks alot 😊!

```auto

//setup my camera
setupCamera(160,120);
function setupCamera(w:int,h:int):void {
    try {
        camera = Camera.getCamera();
    } catch(e:Error) {
        trace("No Camera detected!");
    }
   
    camera.addEventListener(StatusEvent.STATUS, camStatusHandler);
    camera.setMode(w,h,stage.frameRate);  
    video = new Video(w,h);
    video.attachCamera(camera);
    video.x = 350;
    video.y = 20;
    addChild(video);
}

```

```auto

//cam function takephoto
function takephoto(e:MouseEvent):void
{ 
        imgBD = new BitmapData(video.width,video.height);
        imgBD.draw(video);
   
	imgBitmap = new Bitmap(imgBD);
	
	imgBitmap.x = 350;
	imgBitmap.y = 20;
	
        addChild(imgBitmap);
	screenSActive = true;
 
        but_capture.removeEventListener(MouseEvent.CLICK, takephoto);

}

```
