How to detect the color of an image using AS3 and adobe air? - actionscript-3

I'm having a hard time finding any data on how to detect the color of an image taken from a phone's camera using adobe air. The idea is that the user takes an image and then the app (that uses this code) detects the color of the item the user has photographed by placing a cursor on top of it.
So does someone please tell me how is this attainable in adobe air and action script 3.
many thanks in advance!!!!

You can use getPixel or getPixel32 from BitmapData() enter link description here
Than you can convert it to HEX if you wish.

Related

How to put a frame on camera while capturing Image using jquery?

I am making a website to capture image ID. I am using webcam.js How can I put a frame on camera when it is accessed on mobile web browser and crop the area outside the frame to focus only on the captured ID? I cannot find any documentation on webcam.js. Please help me. Thank you

Save picture of current screen to disk AS3

I want to add a button to my flash game (AS3) and on click it saves a picture of the current users whole screen and saves it to pictures/disk automatically, but I don't know how to do that, I know how to add the button to the UI and add a click event and all that, just need to know how to make it save a picture of the current screen to disk (doesn't have to be just the flash screen, can be the WHOLE screen of the users pc, either way works!)
I was on my way writing you the answer but I found this post have a better explaination: Is it possible to capture the screen and save the image in actionscript 3?
"Yes, it's possible.
Draw some display object to a BitmapData (the stage, for example) and crop it if neccesary (the second param of BitmapData::draw will help you out here).
Then, convert the raw pixel data to JPEG or PNG using some encoder. I'm sure up to this point, this is what those tutorials will explain you how to do.
Now, the third step is different but simple enough. Instead of sending the image data to a server side script, use a FileReference object. Since Flash Player 10, it has a method called save, that prompts the user to save a file locally.
Since this is a desktop app, you could also make it an AIR app. This will give more direct access to the file system and other features, in case you need them."

How set wallpaper in flash as3?

Who can help me to make the photo On the desktop ..For example, to save the image in the stage in Flash and make it a background in desktop(in flash function to make an image as wallpaper)or background in phone Using the button thanks..
It's not possible to set an image in flash to become your desktops wall paper. You can adjust the images size and parameters via flash and export, then you will have to set it as our desktop wallpaper manually.
For the desktop platform, you can encode the image into an OS-readable format (PNG, JPG, others depend on OS) and call FileReference.save() with the encoded ByteArray. This will invoke the OS-specific dialogue of "Save as" where the user will have to input the proper name for the file with its extension (if OS requires an extension), so you will have to hint the user of what type of file he will receive. For this, you can name your button "Save as PNG", for example. A code example is here in this question.

Using ICC Profiles in as3/flex

I am creating a flash site where someone can customize a canvas. Then they can preview this canvas on the product. Because of the way monitors display colors, we wanted to try to embed an icc color profile in the previewed image so the user can get a better idea of what the end product will look like. For instance, if they upload something with a really bright red, the preview will show this in a more realistic color to what can be printed on the canvas. This preview is generated on the fly in a flex application using as3.
How I could go about doing this? Is this possible? I realize I could fake something by manipulating colors in flash, but the printer that prints the canvas is able to export an icc profile that will be more accurate. So, I'd like to use that if possible.

AS3 Camera selection

Has anyone build a AS3 Camera-Select-algorithm, ready to use?
With MacBooks you have the problem that the build-in webcam is not rightly choosen from the webplayer.
You have to select the USP-Cam by youself from the list
DV Video
IIDC FireWire Video
USB Video Class Video
by
camera = Camera.getCamera("2");
THNX!
I found kind of a workaround here
You cant actually set the camera programatically. The best you can do is prompt the user to set it next to a video panel to show them if the camera they've chosen actually works. example here: http://www.neave.com/webcam/
to prompt them to change cameras you use:
Security.showSettings(SecurityPanel.CAMERA)
there is no event to wait for, though you can poll your video panel's bitmap data for changes and prompt the user behind the security panel when you think they've chosen the right camera.
Having done battle with this problem, I would suggest that everyone use this library.
https://github.com/cataclysmicrewind/CameraDetection/
Flash + webcam should = easy + awesome.
Unfortunately, it is pain + suffering.