Flex - Find The Color Of A Pixel At A Point Within A VGroup?

Jul 29, 2011

I'm having trouble with this code

var imageMap:ImageSnapshot= ImageSnapshot.captureImage(object);
var pixelValue:uint = imageMap.bitmapData.getPixel(x, y);

View 1 Replies


Similar Posts:


Actionscript 3 :: Flex: Find Which Element Is Clicked In Vgroup?

Aug 26, 2011

I am dynamically creating 10 textinputs inside a vgroup . when user clicks a button, I want to fetch the text present on all textinputs. How to do this. My code looks like this

var vgroup:VGroup = new VGroup;
for(var i:number=0;i<10;i++){
var textinput:TextInput=new TextInput();
vgroup.addElement(textinput):
}

View 1 Replies

Flex :: Float - 4: While In A Vgroup - Add A Moveable Element That Won't Be Part Of The Vgroup?

Jun 22, 2010

I created several components that are placed inside a VGroup. in one of the components code, i want to add an image and to move it. i don't want the image to be part of the vgroup and to be bound to the vgroup area, i want it to be like float in css. how can I do that?

update I want to be able to move the element in the entire area of the application. not to move it within the vgroup. i don't want this object to be attached to any container besides the main application window in order for me not to have limits how much can i move it and where.

[Code]...

View 1 Replies

ActionScript 3.0 :: Calculate What The Average Color Is By Retrieving The Color Of Each Pixel

Jun 19, 2009

I need a function that retrieves the average hexadecimal color values of a group of pixels in a square. Like a 4x4 area, and I want to be able to calculate what the average color is by retrieving the color of each pixel.

View 4 Replies

Actionscript 3 :: Retrieving Pixel Color On Color Picker

Sep 28, 2010

I'm currently making a color picker (pretty standard one, pretty much the same as photoshop with less options at the moment: still in early stage). Here's the picture of the actual thing : [URL] The problem is : to retrieve the color of the pixel that is under the color selector (the small one, the other is the mouse), I have this line that I thought would do it :

_currentColor = Convert.hsbToHex(new HSB(0,
((_colorSelector.x + _colorSelector.width/2)*100)/_largeur,
((_colorSelector.y + _colorSelector.height/2)*100)/_hauteur
));

Just to clarify the code, I simply use the coordinates of the selector in order to create a new HSB Color (saturation is represented on the X axis and brightness (value) on the Y axis of such a color picker). I then convert this HSB Color to Hexadecimal and assign it to a property. The hue is always set to 0 at the moment but this is irrelevant as I only work with pure red to test. It partially does what I wanted, but the returned color values are inversed for most of the corners:

[Code]...

View 3 Replies

Flex :: Find Point In Area Of Outer Circle?

Dec 23, 2010

I have two circles, an inner circle and an outter circle. I'm trying to find points that reside within the area between the edge of the inner circle and the edge of the outer circle.

View 1 Replies

Flex :: Actionscript 3 - Find Upper Right Point Of Rotated Rectangle?

May 2, 2010

I have a rectangle of any arbitrary width and height. I know X,Y, width, and height. How do I solve the upper right hand coordinates when the rectangle is rotated N degrees? I realized if it were axis aligned I would simply solve for (x,y+width). Unforunatly this doesn't hold true when I apply a transform matrix on the rectangle to rotate it around its center.

View 2 Replies

ActionScript 3.0 :: Find Egistration Point Compared To Its Top Left Point

Aug 20, 2009

if i have a movieclip or a sprite could i find (via code) where is its registration point compared to its top left point (no rotation included) ?

View 4 Replies

ActionScript 2.0 :: Find An Angle From An Anchor Point And A Moving Point?

Feb 19, 2005

I know some basic trig. but how do i find an angle from an anchor point and a moving point?

adjecent = _root.anchor._x-_root._xmouse;
opposite = _root.anchor._y-_root._ymouse;
hypotenuse = ((adjacent ^ 2)+(opposite ^ 2)) ^ 0.5;

View 2 Replies

Flex :: Find Right - Leftmost 2d Point Of A Horizontal Circle In 3d Vector Environment?

May 20, 2010

I'm drawing a 3D pie chart that is calculated with in 3D vectors, projected to 2D vectors and then drawn on a Graphics object. I want to calculate the most left and right point of the circle after projected in 2d. (So not 0 and 1 Pi!) The method to create a vector, draw and project to a 2d vector are below. Anyone knows the answer?

[Code]...

View 1 Replies

Flex :: Comparing Bitmap Data In AS3 Pixel For Pixel

Mar 30, 2010

I am looking for a fairly simple image comparison method in AS3. I have taken an image from a web cam (with no subject) passed it in to bitmap data, then a second image is taken (this time with a subject) to compare this data, from these two images I would like to create a mask from the pixels that match on both bitmaps. I have been scratching my head for a while, and I am not really making any progress. Could any one point me in the right direction for pixel comparison method, something like getPixel32()

View 2 Replies

Professional :: Restricting Decimal Point Positioning - Using Whole Pixel Numbers?

Mar 2, 2010

I've frequently come across the issue when placing a movieclip or bitmap, the resting position of said object will land on a decimal value, not a nice, full pixel value. For instance, I drag a movie clip into a scene and it lands on a position of: X: 27.2, Y: 56.9, when I'd like it to be X: 27, Y: 57.
 
Now, this wouldn't bother me as much if I were dealing only in vector shapes. I currently work as a developer in the videogame industry and often times, for optimization purposes, I need to use both bitmaps and vectors. Plus, as a UI designer, text is very important to use throughout a game's UI. If you notice, when a font gets placed in an in-between position related to pixels, the text becomes blurry looking in appearance (graphical elements around the text can also appear blurry when in between pixel values as well). This can make UI pages or HUDs look sloppy and unprofessional.
 
I've tried enabling snapping (including enabling the grid, setting the grid to 1x1 pixel, then enabling both pixel snapping and grid snapping), but nothing seems to help in getting objects to place on whole pixels. Yes, I can manually change pixel values to whole numbers (which I'm currently doing). But when you have to manually position 100 keys on a keyboard, it gets old pretty quick!

View 5 Replies

Actionscript 3 :: Find A Pixel-perfect Collision Detection Function

Mar 18, 2010

I was searching for a simple collision detection function for as3, I found Collision Detection Kit, but it is too complicated, I just want a damn function that I give 2 objects as paramenters and that's it.I would like to know where can I find a pixel-perfect collision detection function (The faster, the better)

View 2 Replies

Flash :: Using A Vgroup As A Drop Target In Flex

Dec 3, 2010

Is it possible to use a VGroup as a drop target in flex? I like the functionality of a vgroup (adding elements easily, etc) but I haven't found a way to get it to register when things are dropped on it.

View 1 Replies

Flex :: Use VGroup Or HGroup In Pure Actionscript3?

Sep 3, 2011

I'm developing a flash app by using free Flex SDK and text editor and compiling in command line.

I want to use VGroup or HGroup in my actionscript to manage positions of DisplayObjects.[code]...

View 1 Replies

Actionscript 3 :: FLEX 4.0 Vgroup Seems Not To Draw Their Elements?

Jan 23, 2012

I got a component made with an spark Group for a survey, inside of it I have an algorithm that create the questions putting RadioButtons inside of a VGroup(dynamically).The problem is that sometimes when I call the next question, I couldn't find why, they are not drawn unless I click the right mouse button so it appears normally.

public function nextQuestion(event:MouseEvent):void
{
destroyQuestion();[code].....

So, when I run the application and I move through the questions, sometimes, the question is not drawn (exemple: I'm at question 2 and I move to the third question and it's blank, but if i press the right button in my mouse the question suddenly appears. So I move to the fourth and everything seems right)

View 1 Replies

Flex :: VGroup Or List Doesn't Fit Into TileWindow, Is Too High

Nov 27, 2011

how to make the List and Checkbox (inside a VGroup) to fit into a TileWindow?

The complete source code Text.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code].....

View 1 Replies

ActionScript 3.0 :: Get Vector Pixel Color?

Oct 28, 2010

Grab the color of a vector item at a specific pixel without converting it to a bitmap object and then using getPixel?

View 8 Replies

ActionScript 3.0 :: Get Color Of A Pixel On Stage?

Jun 8, 2011

Is there a way to retrieve the color of a generic pixel on the screen using the mouse pointer inside the Stage of Flash Player? With the getPixel method of the BitmapData class you can get the color of a pixel only if the mouse is over a bitmap image, but what if I need the color a generic pixel on the screen?

View 4 Replies

Actionscript 3 :: Change Pixel Color With It?

Mar 10, 2011

Say I have drawn a triangle with[code]...

When the user clicks a point inside the triangle, we will get the x and y coordinates, do some calculation with those values and get some (lots) of pixel coordiantes accordingly (all of those calculated points will be within the triangle). And finally, change the color of those points (something different than triangleShape fill color).

View 1 Replies

Flex :: Change S:VGroup Height When Child.visible Set To False

Nov 12, 2010

I have a code similar to this:

<s:VGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="label" />
<s:TextInput id="rmName"/>

[Code].....

I want that the s:VGroup container has the height only of its visible children. In this example there is a free space even the visibility mx:HorizontalList is set to false. Every time I change the visibility of the child element I want that the parent (s:VGroup) will change his height. How to do this in flex?

View 1 Replies

Flex :: VGroup - (Parent) Container Does Not Change Height With Children?

May 13, 2011

I have code like the following:
<s:VGroup gap="10" id="group" height="100%">
<s:Label text="This is page 2" />
<s:Button content="Resize Canvas" click="resize(event);"/>
<mx:Canvas id="photoCanvas" color="#567898" backgroundColor="#125567">
</mx:Canvas>
</s:VGroup>

I don't understand why the following does not work:
Pushing the Button resizes the photoCanvas's height (gets taller or smaller). Since the photoCanvas control is a child element of the VGroup shouldn't the container update itself to the new height? The Vgroup has ALWAYS the same height, no matter what the (total) height of the children is! I would like the VGroup to adjust itself and get a height value equal to the sum of its children heights. Is this not possible??

View 1 Replies

ActionScript 3.0 :: Get The Color Of A Pixel That The Mouse Clicks On

Oct 15, 2008

Is there a way to get the color of a pixel that the mouse clicks on. I want to load text into a dynamic text box according to that color.

View 12 Replies

ActionScript 3.0 :: Get The Pixel Color Of A Graphics Object?

Jul 19, 2009

for example,graphics is an object from a movieclip ojbect.I want to get the pixel color at the x,y location in the movieclip.How to do?

View 5 Replies

Actionscript 3 :: Checking Pixel Color Value Of A 3D Object?

Oct 6, 2011

I have a spinning sphere, built using the away3D engine, it is wrapped in a bitmap. I need to be able to check the color value of the pixels in the sphere, however BitmapData only plots the 2D image, not the 3D sphere. So, the values become wrong. If I try to apply it to the sphere I get nasty errors. I have literally been stuck on this for days.

View 1 Replies

ActionScript 3.0 :: Pick Color In Shape At Pixel 0,0?

Feb 10, 2011

is it possible to pick the color of a uni filled shape? If not, is it possible to retrieve the color at pixel x:0 y:0?Otherwise how do I pick that pixelcolor using bitmapdata.

View 2 Replies

Flex :: VGroup: How To Have A New Element Show Up Smoothly (resize) When Added/removed

Apr 20, 2011

When adding/removing elements to/from a VGroup I need it to happen smoothly, resize the item. I believe I have to use transition effects. But how?

At item (element) level? At VGroup level? Should I use a DataGroup instead and do it at ItemRenderer level?

I've been trying to do it at item level but I still didn't manage to make it work and somehow it doesn't feel right. It feels like it should be done at a higher level.

For example, I defined a "death" state which resizes the item to height=0. But then, after it shrunk, it has to somehow notify VGroup in order for it to be removed or remove itself from VGroup. It feels unnecessarily complicated.

way to associate an effect to inserting and removing items from a VGroup?

View 2 Replies

ActionScript :: Getting HTML Layer Pixel Color In Flash?

Dec 7, 2010

I'm quite new to ActionScript and I was wondering is there a way to get the (pixel) color of the HTML layer under a flash movie? I have an idea of making a transparent flash movie covering a part of a website and then getting the color of underlying HTML layer, to make some realtime transformations or other stuff.

View 2 Replies

Flash :: Turn Off Color Ranges In Pixel Bender?

Feb 23, 2011

What is the best way to turn turn off (using PixelBender) colors that fall within a certain range. For example, turn off all colors between 0x0000FF and 0x00FFFF. This has to work in Flash.

View 2 Replies

ActionScript 3.0 :: Check Pixel Color Value Of Bitmap Through MouseEvent

Oct 5, 2011

I have a bitmap with many colors on it. When the user clicks each color needs to trigger a different method. However, I have no idea how to check the color value of the selected bitmap. I can create a new sprite and check the value of that fine through bitmapdata.getpixel() but when I need to actually check the actual bitmap I cannot get it to work.

View 2 Replies







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