ActionScript 2.0 :: Creating BitmapData From Camera?

Nov 26, 2009

I have the following code:

ActionScript Code:
_camera = Camera.get();
_camera.setMode(320, 180, 12, false);
_video.attachVideo(_camera); //attaching to Video object

[Code]....

2) why is the image from the camera so small? It doesn't fill the 320x180 white background, it's size is actually 160x120. Is this some Flash limitation or how exactly did it get to this size?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Creating Masks From BitmapData

Oct 17, 2009

I'm trying to modify the alpha layer of a bitmapData by taking a source iamge and masking out areas that don't have the correct channel. ATM I'm using copyChannel to achieve the effect, but I'd liek more than 3 channels (use alpha kills the other channels it seems). 255, 0, 255 should be able to act as another mask.

This is what I'm doing now...

Code:
bitmap.bitmapData.copyChannel(tempMask, new Rectangle(0, 0, tempMask.width, tempMask.height), new Point(0, 0), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);

So the red parts of the image mask out the source image. All I want is to be able to mask out things basic on multiple channels (the lesser of the 2).

1) How does copyChannel work? Can I just test each pixel manually and achieve relatively similar speeds? and 2) if the Flash inline functions are infact faster, is there a function that can do what I want, or would it be better to use a shader?

Code:
var tempBitmapData:BitmapData = new BitmapData(tempMask.width, tempMask.height);
var matrix:Array = [];
matrix = matrix.concat([0, 0, 0, 0, 0]); // red
matrix = matrix.concat([0, 0, 0, 0, 0]); // green

[Code].....

View 1 Replies

ActionScript 2.0 :: Creating BitmapData Object Of Jpg

Sep 4, 2007

I am trying to create a BitmapData object of a jpg that is loaded into a movieClip, so that I can then remove the jpg and have just the BitmapData of the image to manipulate. I have the original image loading into my temporary MC without any problems..and am using a listener to check to make sure that the image has been fully loaded before it moves onto creating an empty movie clip for the BitmapData... but for some reason the BitmapData isn't working as nothing shows up in my holderMC.. and it says the width of the holderMC is 0 when it should be something liek 367 for the 'surf.jpg' test image I am using. My code is below..

Code:
import flash.display.BitmapData;
stop();
_root.createEmptyMovieClip("tempMC", 1, {_alpha:0});

[Code].....

View 1 Replies

Media Server :: Creating An Interface With Several Video Windows Where A User Can Connect Their Own Camera To Window?

Feb 13, 2012

currently I use the following workflow for Live video streaming.I have FMLE on a computer streaming the Video feed to my FMS.I currenlty use  Dreamweaver to create window with a few instances of a video window and one of the windows is configured to rtmp to my server and the stream name of the stream I have setup in FMLE.This then streams to one of the windows.I then assign a different Stream name to the other windows.

I send an FMLE client to a user in the locations that want to have a video presence on the webpage.I send them instructions and running FMLE and the parameters to use to get their camera up and running.This works fine to a point.Most of the users are not technically minded and so often this leads to issues and delays to get these things to work.
 
I want to move on and improve this flow.I want to create the video instances on the page where:Below each video window is a text input field where a user can type in their name which will be used as the stream name.Below each video window is a button that the user clicks to connect their camera automatically without having to install FMLE.Once the video feed is running, only that user can click the button again to disconnect it. ( The button changes to "Stop Broadcast" etc).
 
I have looked at the structure of Ustream for example, and this seems to be the method they use as you can download the XML file of your channe,l and the RTMP URL and stream name can be copied and then used directly in FMLE and you can stream with more control of your camera that way.

View 1 Replies

Flex :: Creating Dynamic Class For Bitmap Containing BitmapData From SWC?

Jun 1, 2011

I have the following code

///Get BitmapData from library in SWC
var ClassReference:Class = getDefinitionByName(products[i].producticon+"Data") as Class;
// Create new BitmapData Instance From it

[Code]....

I get null in the trace. How do I make a dynamic class that I can refer to for this bitmap similar to how your reference a class from and embedded media?

View 1 Replies

ActionScript 2.0 :: BitmapData - Creating New BGHolder Clip On Resize

Aug 21, 2008

I am using bitmapdata to make me a nice lil' background image, and it works great...until it's resized. Whats happening is it's creating a new bgHolder clip on the resize, NOT resizing the current empty clip "bgHolder"

Here's the code:
import flash.display.BitmapData;
#include "mc_tween2.as"
Stage.align = "TL";
Stage.scaleMode = "noScale";
var myListener:Object = new Object();
myListener.onResize = function() {
[Code] .....

View 1 Replies

ActionScript 3.0 :: Creating Scratch Lottery Ticket Using BitmapData Class?

Nov 5, 2009

I'm trying to make an scratch lottery ticket in as3 by using the bitmapData class. The scratch function is working fine, but I want to add an function that is challenging. When 75% of the lottery ticket surface is scratched of I want to trigger an event.

My ActionScript Code:
var toolsize = skraper_mc.width;
var tooloffset = toolsize/2;
var basepoint = new flash.geom.Point(0,0);
var bitmap:Bitmap=new Bitmap();
[Code] .....

View 4 Replies

Actionscript 3 :: Get Full Camera Area Captured Inside Flex Using Camera.getCamera ?

Apr 1, 2012

I am capturing camera on flex for android using air 3.1,and found that the camera is only showing the a part of of actual camera video.When i view camera using normal camera application in android galaxy tab, it shows full camera area but when i am capturing the camera in flex its showing only the center area for it.I tried using setMode to set the resolution, but its not of any use.Is there any way to get full camera area captured inside flex using camera.getCamera ?

View 1 Replies

Webcam - Detect Flash-accessible Camera Without Prompting User For Access To Camera If One Exists?

Oct 11, 2010

From a Flash object, I would like to be able to detect the presence of a webcam that the user might grant access to, without actually asking the user whether they want to grant access. This is to streamline a large application that has extra features if a webcam exists — if there is a webcam, the application will present several dialogs that lead up to the normal cam-security prompt, but if the user doesn't have the hardware, I want to skip over them altogether. Requesting access to the cam before those dialogs won't make sense to the user.

It appears not to be possible to call Camera.getCamera() without the security prompt happening. Is there a workaround? (For instance, could I, perhaps, call getCamera in a hidden Flash object and inspect its return value, or does it block until the user acknowledges the security prompt?)

View 3 Replies

Media Server :: Broadcasting From Camera Blocks Other Applications From Using The Camera?

Jun 10, 2009

I have a video capture device on a machine. I have written a windows application to capture the video from this device. While capturing, if i try to broadcast using flash it does not connect. If i'm already broadcasting and then try to capture then my windows application does not get the capture pin of the device. So, flash seems to be taking the capture pin. Is there anyway to broadcast using the preview pin on the device so that i can capture using my application. Or is there way where i can split the capture pin and give one to my app and one to the broadcaster

View 10 Replies

Camera - Access The Video Data From This Camera With Flash?

Oct 20, 2010

Usually Adobe Flash applications can access any usb-webcam.I have a USB camera for microscopes which understands TWAIN and DirectShow.Is there a possibility to access the video data from this camera with flash?

View 1 Replies

ActionScript 2.0 :: Flash 8 BitmapData - Getting Error : The Class Or Interface 'BitmapData.loadBitmap' Could Not Be Loaded?

Jan 31, 2007

I'm using Flash 8, with this code in the first frame:

import flash.display.BitmapData;
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;[code].....

When I publish the file, I'm getting the following error message in the Output panel:

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded.
var plaid:BitmapData.loadBitmap("plaid");

Total ActionScript Errors: 1 Reported Errors: 1

View 8 Replies

ActionScript 3.0 :: Error #2015: Invalid BitmapData At Flash.display::BitmapData()

Oct 14, 2009

I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source .html" but I keep getting this error:
 
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData()
at Reflect()
at Site_fla::GalleryPage_29/loadThumbs()
at Site_fla::GalleryPage_29/sortXML()

[Code]...

btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection..

View 10 Replies

Actionscript 3 :: Quickly Rotate The Pixels That Make Up BitmapData Without Using BitmapData.draw()?

Dec 29, 2011

I've been using BitmapData.copyPixels() to draw graphics onto a canvas (Bitmap).I need to rotate the resulting graphics without the use of draw() because it's vastly slower.How can I rotate the target graphic? I'm assuming that there might be a formula or library that I can use which will first reorganize the pixels that make up a graphic based on an origin (point) and radians.I'm pretty certain that I'm not capable of creating such logic, so if there are any known libraries that do this, that would be awesome.I'd like to achieve something similar to XNA's SpriteBatch.Draw() method, which accepts rotation as its 5th argument.

View 3 Replies

ActionScript 3.0 :: BitmapData.hitTest - What Angle Or Coordinate Of The BitmapData The Collision Happens?

Sep 1, 2011

how to use the bitmapData collision method. Now I'm trying to figure out if there is a way to see at what angle or coordinate of the bitmapData the collision happens? I need it in order to figure the accurate bounce angle after the collision occurs.

View 2 Replies

Flex :: AddChild A BitmapData Or Draw A BitmapData To Screen?

Jul 15, 2009

I'm currently working on a flash game and I need to know how to addChild a BitmapData or draw a BitmapData to screen. If I can't than how can I give a DisplayObject my BitmapData?

View 2 Replies

ActionScript 3.0 :: BitmapData = New BitmapData(); Eating Up Memory?

Dec 22, 2011

I've made a mobile version of my software, with low-res images and such, and I can now fully buffer all my content (including a 360 frame animation which is buffered to memory). Problem is, that everytime I update the view, more memory is used.When I write image = new BitmapData();, does it store the previously created BitmapData's in memory? Do I have to flush the memory somehow before I draw my second picture in BitmapData?Example:

ActionScript Code:
// In this example I draw using the same bitmapData several times, also
//overwriting the first image. Do I have to somehow delete the data first, to

[code].....

View 1 Replies

ActionScript 3.0 :: Using BitmapData.draw(stage) - Error #2123 Security Sandbox Violation: BitmapData.draw

Jan 9, 2012

I am having an issue with using BitmapData.draw(stage). I am getting the following error:

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access. Here is a portion of my code:

var bd:BitmapData = new BitmapData(2800, 2100); bd.draw(stage);//this is where the error happens All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1. Let me know if I need to supply any more info.

View 4 Replies

Actionscript 3 :: Graphic Object BitMapData Type The Same As BitmapData Type?

Dec 29, 2009

The title might be a little misleading. Look at my code and I will explain

public static function loadTile(tileDir:String = "empty"):void
{
if(tileDir != "empty")
{
tPoint = new Point(0,0);
tRect = new Rectangle(0,0,30,30);

[Code]...

I am trying to do tiling with sprites. I want my tiles to be interactive, so that is why I am using the sprite object instead of using regular bitMaps to represent my tiles. You might be wondering why I wouldnt just use graphics.beginBitmapFill(tImage); and graphics.drawRect(0, 0,tWidth ,tHeight ); to pick out the tiles I want to use. Well reason being is because it turns out that drawRect() first and second parameters actually alter the location of where the actual sprite sits at.

So if I set the x and y properties of the sprite to x = 20, and y = 20. then I set my drawRect(20,20). it actually adds an extra 20 pixels to my x and y coords of my sprite. And I know the reason why, I just need to know a better way.

View 2 Replies

ActionScript 3.0 :: Camera Slowing Down To 4 FPS?

Nov 27, 2008

I have a problem with the camera slowing down in my project.I thought it could be because of the complexity and memory consumtion of this work, so I created a completely new movie, typed such code:

quote:

var camera:Camera = Camera.getCamera();
var video = new Video(camera.width, camera.height);
video.attachCamera(camera);
addChild(video);

[code]....

And... this time the camera's fps stayed 25fps all the time. To be honest - I really don't know why :| I mean, I'm happy the fps stayed stabily at the level, but I don't know what to do in the mentioned, complex, project to make the fps faster. I can't just add the trace line.

View 5 Replies

Video Camera And Flash

Jun 28, 2009

What should I look for when buying a video camera to record videos that could be used with Flacs?

View 1 Replies

AS3 :: Find Out Whether Camera Is Attached Or Not?

Aug 18, 2009

How to find out whether camera is attached or not in AS3.0. It can be installed or not.

View 2 Replies

ActionScript 3.0 :: Flashplayer 11,2,202,228 Using Camera?

Apr 4, 2012

in flashplayer 11,2,202,228, attach camera to video and see local video, sometimes camera movie is freezed when I change Camera.setquality and Camera.setmode. it's not happen older flashplayer. I heard it waste memory in flashplayer 11,2,202,228,

View 2 Replies

Javascript :: Access Camera In A Div?

Dec 27, 2010

In the following why is that the camera does not show up in the div.Is that am i doing anything wrong here

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="swfobject.js"></script>

[code]....

View 1 Replies

Flash :: Access Camera - Use Any API?

Jun 14, 2011

Is there any other way to access the camera using ActionScript 3 other than

import flash.media.Camera;
videoInstance.attachCamera(cameraInstance);

Or should I use any API s? If so, any API suitable and some tutorials if possible.

View 1 Replies

ActionScript 3.0 :: Camera Don't Show Up

Aug 4, 2010

I hate when flash does that. standard code that just wont work for some reason.

Code:
var cam:Camera = Camera.getCamera();
var video:Video = new Video(320,240);
video.attachCamera(cam);
video.x = 20;
video.y = 20;
addChild(video);

I am on macbook pro and my camera doesnt show on the stage. I had a video object there named 'video' i also at some point had the imports for Camera and Video, still no luck. What am I doing wrong. I am sure I had this at some point in the past.

View 4 Replies

ActionScript 2.0 :: 3D Coordinates Behind A Camera

Nov 25, 2003

I just have a problem when a point goes *behind* the camera: if point.z < 0. It's ok if there's an MC that just becomes invisible - but if I try to draw a line to this point with the drawingAPI, the point's screen x/y coordinates are weird. I can't figure out how to modify the scaleRatio to get correct values. Here's a code snippet:

var scaleRatio = focalLength/(focalLength + z);
screen_x = x * scaleRatio;
screen_y = y * scaleRatio;

View 2 Replies

ActionScript 3.0 :: Camera.getCamera End?

Jan 2, 2009

How do I stop the webcam from being on?Once getCamera() is invoked and attacked to a video object, how do you remove or stop the webcam later on?

View 3 Replies

IDE :: Move The 'camera' Around In Flash

Sep 26, 2009

is it possible to move the 'camera' around in flash (cs4 as3) as apposed to moving the scene around it?

View 2 Replies

IDE :: Camera PAN Round Stage

Oct 13, 2009

i have a big set for a new animation im doing but i only want to view one part of it at once and have some sort of camera panning effect going round my stage. is there a plug in or somthing for this. i have looked everywere. I know it can be done as i have seen it before

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved