Flash :: Determine If GetPixel() Value Is Greater Than Or Less Than 50% Gray?
Mar 28, 2010
I am trying to loop through a bitmap and determine if each pixel is lighter or darker than gray using getPixel(). Problem is, I am not sure how to tell whether the value returned by getPixel() is darker or lighter than gray.
Neutral gray is about 0x808080 or R:127, G:127, B:127. How would I need to modify the code below to accurately determine this?
[Code]...
View 2 Replies
Similar Posts:
Mar 23, 2011
i want to know which method is greater for flash website for both performance and bandwidth
1st: Draw all the required graphics using ActionScript
2nd: draw all required graphics in photoshop or flash and load in the flash using actionscript when required
View 1 Replies
Apr 24, 2009
I have just found out that flash wont let me create a movie with width or height greater than 2880. The thing is I have an image of the stage which has a height of 3568px so some clipping has occured and I cannot see the rest of the image when I publish the movie. Is there a way to somehow adjust my movie to this height so that I can see the rest of the image? I have assigned a little AS2 to resize the stage:
Code:
Stage.height = 3568;
However this doesnt work!
View 2 Replies
Jan 19, 2010
I have a scrolling flash gallery. On mouse hover over a thumbnail, a popup with more description is shown. The problem is that my stage height is 200px but the popup requires additional about 200px to show properly. When I embed this in an HTML page with the object tag height set to 200px, i see the scroller completely but the popup get cut from the top. If i change the object height to 400px, it show me the popup fine, but this inserts extra blank space in the html page.
View 1 Replies
Nov 13, 2009
I am facing an issue where the gray box (another version of lightbox) is not displaying over the flash banner. I have added the properties opaque, transparent but it is not displaying properly.
View 1 Replies
Jan 2, 2010
I have a problem when I create flash movies (I have tried Flash slide show maker). The video looks good but when I publish it and view it in Explorer or Firefox it comes with a gray border around it (partly dotted)I have tried to find a solution in different forums but no luck. The gray border is visible even if you havent clicked on the flash movie.
View 3 Replies
Nov 15, 2009
I have a greyscale image and I want to scan the pixels out of the Image and this is what I get :
var i:int;
var j:int;
for (i = 0; i < img.contentWidth ; i++) {
for(j = 0; j < img.contentHeight; j++){
pixeldaten.addItem({x:i,y:j,pixel:bmd.getPixel(i,j)});
}}
But the table doesn't look like RGB Values . (R , B , and G must be the same).
View 1 Replies
Feb 14, 2007
So, I'm using the BitmapData class and getPixel to retrieve the colour of a pixel. It works fine and returns a number like "16706965". I'm not sure what kind of value this is? If I place a 'toString(16)' on the end of it, I get a HEX value, but sometimes it isnt 6 digits long, sometimes 5 sometimes 4, so I can't just convert it from HEX to RGB.
I can make this number into a string with 6 digits, but then it doesnt recognise when I try to convert it to RGB
View 3 Replies
Oct 15, 2009
I have two images, one overlayed exactly over the other. The image in front is what the user needs to see, but the user behind can be considered to be like a map with different fields of color on it representing different things.
What I am trying to do is that when the user mouses over the image, it reads (via .getPixel) the color info of the image behind which prompts certain messages to be displayed.
I am not having a problem with getting .getPixel() to work since when I just have the behind image (colored "map") showing, the color data for each pixel comes up as expected. But, when I overlay the top image, it shields the back image from being able to be "read" by my .getPixel function.
Is there a way to have a movieClip not "interfere" with movieClips that lay behind it in the stack?
View 1 Replies
Oct 15, 2008
I want to getpixel value of a pixel in Stage. Stage is dynamically created and its have movieclips or images, thats are all dynamically created,
But Now I need to get a pixel color value of (150,150) in the stage,
View 5 Replies
Jan 22, 2010
I am having a few issues converting a MC to a bitmap. I have succeeded in loading a graphic from the library, loading that as a bitmap and I can use getPixel to get the color at a certain x,y point.BUT I have another part to the problem. I have a file upload where a user can upload an image and choose a color off that logo. So I have the logo uploading, then getting loaded into an MC on the stage and it all works honky dory.However, when I (thought) I was converting it to bitmap and then use getPixel, every part of it is just returning white.[code]But no matter what co-ordinates I put in, I always get white.
View 7 Replies
Oct 15, 2009
(1) read in a *.png image(2) when the user mouses over the movieclip that contains the image, an RGB value (in 0xFFFFFF format) of the pixel which the mouse is currently hovering over is displayed.Here is what I am doing to try and make it happen:(1) Using the loader class (imageLoader) to load a bitmap (*.png -- no alpha) into a movieclip.(2) Also taking the "imageLoader.conent" and placing it into a "grainImage:Bitmap" object.(3) Using a timer event to fire off data describing the where the mouse is at all times.function readPixelColor(te:TimerEvent):void { trace(grainImage.bitmapData.getPixel(mouseX, mouseY).toString(16));};How can one insert code in these Forums? I used to be able to do that... Oh well, the problem that is happening is that the value that is being returned by this function is off by 010101 (I believe, not certain how hexidecimal works).
Anyway, if the color is really "336699" (as confirmed in Photoshop) my function returns "326598". Which is "336699" minus "010101"why this may be doing this? Are my values "shifted" in some way since there is no alpha? Maybe there is some sillyness behind loading the image into a _mc and also placing the loader content into a bitmap object -- they are interfering with each other in some way?
View 4 Replies
Mar 2, 2011
I'm trying to create a color picker using getPixel. It works wonderfully as long as the image is loaded from a local drive. When I try loading it from the server (a subdirectory on the same server as the SWF), the loaded image doesn't get drawn when I use the draw command. It draws a white rectangle and when I use getPixel, I always get 0xFFFFFF. I also have system.Security.allowDomain("[URL]") in my script, but nothing works.
View 6 Replies
Sep 18, 2008
I'm writing an applicaton which acts based on different colour values of pixels in a png image created in Microsoft paint. However, when I load the image into a BitmapData object, and then parse through the pixels reading their values using getPixel() or getPixel32() (I've tried both) I seem to be getting values which are slightly inaccurate compared to what was saved. For example a pure white pixel which should be read as 0xFFFFFFFF often comes out as 0xFFFFFFFE. The behaviour of the program is dependent on the exact value of the pixel so these errors usually break it.
Sometimes the problem is intermittent so seems fixed but actually isn't. Is it to do with the PNG format? I thouht png was lossless so should deliver accurate pixel values at all times?
View 5 Replies
Jan 11, 2012
I've created a simple drag-and-drop dress-up game. The aim is that users will create a monster by dragging and dropping, and that an image of that monster will be sent to me, and I will create a toy that looks like the monster.
So once users are happy with the final look, and have filled in their details on the page, I would like them to be able to click a button that will send me the encoded jpeg of how the swf currently looks. I could then recreate the image using image magick or something similar, I guess?
I realise that this may require PHP, but as I have never used it before I thought that perhaps it may be possible to use getpixel to get an encoded text string of the stage and then send that to myself via "mailto"?
View 0 Replies
Aug 18, 2009
I'm building an application where the user can upload a photo of their head, scale it and position it, and then pick a colour from the photo.The photo gets put into a movieclip called 'head'I'm stuck at the colour picker part and I just can't seem to work out the whole bitmapData thing. Here's my colour picker code -
ActionScript Code:
private function beginColourPick():void
{
_bmd = new BitmapData(head.width, head.height);
[code]...
This code kind of works, but not correctly.
Problem #1: The colour picker only works in the bottom right quarter of the image because I moved the head mc so the registration point is bang in the middle. So the problem here is that I can't figure out how to move the bitmapData in line with the head mc.
Problem #2: If the user scales the head mc (even a tiny bit) the colour picker stops working altogether. Now I'm thinking I've got to use a transform matrix - but I read up on it and haven't got anywhere.
View 7 Replies
Feb 27, 2007
Why would
if(vol > 0){
trace("worked");
}
NOT work if the value is a decimal value between 0 and 1?The trace only works sometimes. I didn't note though at what value it worked..STUPID ME...forgot and plus, it was 2AM.I am reading in an array ..byteArray, and then passing readFloat to vol.
View 6 Replies
Jan 13, 2010
I have an actionscript pulling data from an xml file. As you can see in the code below, I have textFields been created on the fly.I need to have the "resultsField" textfield to be programatically filled with the greater value from either "column1" or "column2".[code]
View 24 Replies
Mar 29, 2010
It's possible to print in flex image (high resolution png/jpg file) with print quality greater than 72DPI?
View 1 Replies
Oct 3, 2005
The below function goes through once, increments the _alpha of picture1 and then exits....wont loop until _alpha is greater or equal to 100.
function delaytext() {
if (picture1._alpha >= 100) {
picture1._alpha = 100;
trace("complete" + picture1._alpha);
} else {
picture1._alpha += 1;
}}
View 7 Replies
Dec 13, 2010
I'm working with a video in Flash where I am capturing each frame and testing the color of a single pixel. I'm using it to determine when a white/transparent background changes to be a color. The following AS2 code works flawlessly when I preview it in Flash and on my desktop in the browser (the direct SWF and placed inside HTML using SWFObject) but as soon as I upload it to my server it fails and produces "FFFFFF" continuously regardless.
this.onEnterFrame = function()[code]..........
There is no difference in the files; they are both pulling from the same video source (hosted on an Flash FLV server).The only difference is one set of files is hosted on my local computer and the other is hosted on my web server.
View 2 Replies
Aug 13, 2009
I'm trying to write code so that when the variable p_bw is greater than 0, an event is called. I've read that I need to use dispatchEvent but I can't seem to get it working .Here is my code....
package CIS.FLVPlayer[code]............
View 10 Replies
Apr 5, 2012
ive been going at this for three days now, and i have no hear left to lose.... it only goes gre in the browser, and usualy takes three playbacks before it goes grey.
[Code]...
View 1 Replies
Nov 26, 2010
First time using bitwise and i have the following problem:
Let's say i have 1110 in binary (binary=1110)
I want to convert it to Gray code. So basically i have to apply it a bitwise right shift and xor the result with the initial value.[code]...
View 3 Replies
Aug 1, 2009
I need to create, from a given Bitmap/BitmapData of a PNG file which has transparent and semitransparent pixels, another BitmapData which is a copy of it, but all the pixels (well, the pixels that are not alpha 0% actually) must have a specified grey color value (0xdddddd).
View 2 Replies
Jun 17, 2009
The colorpicker component is missing the gray color range ... is there a way to add the gray color range in the component?
View 2 Replies
Apr 4, 2012
trying to add an asset to an unlocked layer in my Flash project, but File>Import>Import to Stage (Cmd-R on Mac) is grayed out.why is this? is flash telling me that my stage is some how inactive? I am in the scene. I see other graphic elements...my layer (in a group) is unlocked as is the parent of the group.
View 5 Replies
Oct 11, 2005
I need to create a color formula converter that goes between HEX, RGB, CMYK and Gray Scale.
With wonderful help from members of this site, I have the HEX to RGB to HEX portion working. Particular thanks to JSEBRECH on color formula conversion and previously to GIBBERISH for helping me master updating arrays from changed input text fields, and with other important help from DEADBEAT, VREELPOWER and PAEREZ. You have all been very helpful and generous.
how to convert either HEX or RGB to CMYK or to Gray Scale?
View 8 Replies
Jul 18, 2006
Is there anyway to create an alpha mask out of a grayscale image in flash?i am using the color adjust filter to create a bleached out kind of image. I would like to make the white transparent.
View 1 Replies
Jun 20, 2007
I need to be able to disable/grayout SOME items in a list component.
View 1 Replies