ActionScript 3.0 ::make All White Pixels In Bitmap Transparent?

Jul 29, 2008

i want to make all white pixels in my Bitmap transparent. i found the treshold-method and try to use it:

Code:
var pt:Point = new Point(0, 0);
var rect:Rectangle = new Rectangle(0, 0, 2000, 2000);
var threshold:uint = 0x00FFFFFF; // all white Pixels

[Code]....

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Loop Through Bitmap Data And Detect White Pixels?

Oct 24, 2010

I would like to somehow loop through bitmap data and detect white pixels.. If i find a group of white pixels forming a big enough area (lets say 300x120) i would like to somehow ad text to that area..

View 9 Replies

ActionScript 3.0 :: Use The BitmapData.setPixels Method To Set Certain Pixels In The Bitmap Transparent?

May 2, 2009

I am trying to use the bitmapData.setPixels method to set certain pixels in the bitmap transparent.But no matter what I do, it always seems to set the pixel(s) black (non-transparent).Here is my code:

[AS]
bmpd = new ImageFromLibrary(0, 0);
bmpd.setPixel(0, 0, 0x00000000);
[/AS]

why its not setting the pixel(s) transparent?

View 4 Replies

ActionScript 3.0 :: Remove Transparent Pixels From Transparent Png?

Feb 27, 2010

I am creating a map in flash cs4 with all the countries on it. I used photoshop for creating the map and separated countries. Now I imported all pngs in Flash and I want to give Mouse CLICK event and Mouse Hover on all pngs, but as the transparent pixels are overlapping the other states, it is getting difficult. So, I converted all pngs in movieclips and now then I broke up pngs. Now I want to delete all pixels having alpha 0 using eraser tool, as per the borders. And I have to do it manually for individual countries. So is there a way to remove transparent pixels from the bitmap data?

View 2 Replies

ActionScript 3.0 :: Part Of The Pixels Are Transparent - Don't Be Clickable

Sep 13, 2009

I want to create a SimpleButton that has some  PNG/GIF graphics as the down/up states. Part of the pixels are transparent and I don't want them to be clickable, is that doable?

View 9 Replies

Flash :: Set CopyPixels To Ignore Transparent Pixels?

Mar 17, 2011

I have a BitmapData object with transparency (the sourceBitmapData parameter). Every time I use copyPixels() to copy it onto another BitmapData object the transparent pixels replace whatever is beneath them. I would like the copyPixels() function to simply ignore these fully transparent pixels (0x00) and NOT copy themBTW, I've tried setting the alphaMerge to true but that doesn't solve the issue - the whole source object just goes black and ignores ALL transparency.EDIT:

Here are the code snippets;
var b:UIComponent = new UIComponent();
b.graphics.beginFill(color, opacity);

[code].....

View 3 Replies

Flex :: Color All Pixels That Are NOT Transparent To Black?

Aug 5, 2011

I am using ColorMatixFilter on an Image in Flex. I am really close to getting want I need out of the filter.Basically any PNG file the user uploads I want all pixels that are not transparent to be colored black. I have a function that sets the "brightness" already so I just through a really large negative number at it like -1000 and it does the job but the problem is any pixels that have any alpha to them, say 0.9 or below all end up being white when I encode my PNG file on the server later.

[Code]...

I would like all pixels to be solid black unless the pixel is completely transparent and not sure how to tweak the values to get that out of it.

View 1 Replies

Flash :: Trim Away The Transparent Pixels Of The Image?

Nov 16, 2011

I have a Flash fla file that contains a whole lot of images. The majority of each image is composed of transparent pixels with a visual object in there somewhere. Each image at the moment is at {x:0, y:0}.I want to trim away the transparent pixels of the image down to a minimum bounding box, but keep the object at the same global position. This requires shifting the trimmed image to the global position of the object in the untrimmed image.This is not so much a problem, but the fact that the images are all contained in a fla is the problem. The options I see at the moment are:

investigate JSFL, the Bitmap object has a getPixels, this in combination with a selection and delete operation could work save the fla to xfl and enumerate the images and associated xml with something like Ruby + image processing lib

Questions: Does anyone know upfront if this operation is possible in JSFL? Have anyone done much automated processing of xfl files? Is there an off the shelf image processor that can perform this trimming operation?

View 3 Replies

ActionScript 3.0 :: BitMaps - Remove Transparent Pixels?

Jan 28, 2009

Iv created an app in work which needs a rubber. I basicly have a tool to draw line (paint/pencil). This draws over the entire stage area, including over buttons and interactive mc's. Once i draw the line i then want to be able to erase bit of it.

To this end iv made an eraser tool, which works well. I turn the line into a bitmap, then turn the eraser line into a bitmap and use BlendMode.ERASE to erase one from the other. My problem is, because when creating the bitmatdata i have to create a rectangular shape, the area created then means that i cant access any of the buttons underneath.

here is my code:

ActionScript Code:
//line array is an area of all the line objects which are currently live on stage.
for(var i=0; i<lineAr.length; i++){

[code]....

The way i see it i need to remove the transparent pixels from delBitMap once the erase has been done.

View 2 Replies

ActionScript 2.0 :: HitTest That Ignores Transparent Pixels?

Jun 17, 2009

Is there anyway I can do a hittest that ignores transparent pixels? If so how would I do it.

View 2 Replies

ActionScript 2.0 :: Copypixel Not Replace Transparent Pixels?

Aug 4, 2009

I'm trying to use copypixel to copy an image and paste it onto an existing bitmap. However, the image I'm trying to copy has transparent pixels so when CopyPixel's pastes the image onto my existing bitmap, the pixels already on the image is replaced by the transparent pixels from my image.

How can I make it so CopyPixel will only paste all pixels besides the transparent ones onto my bitmap?

View 2 Replies

ActionScript 3.0 :: Knowing If A BitmapData Contains Transparent Pixels?

May 13, 2010

I have a list of images, and without scanning through each pixel in each image, I want to find out if the image contains transparency (at least one non-opaque pixel).Is there a shortcut to do this (like a property of bitmapData object) rather than looping through the pixels?

View 5 Replies

Flash :: Narrow A Rectangle Within A Sprite To Exclude Transparent Pixels?

Oct 2, 2011

I have a Sprite that contains opaque objects surrounded by transparent pixels. I also have a Rectangle that represents a part of the Sprite that I want to render using BitmapData.draw(). The problem is that the Rectangle that I obtained also contains transparent parts. How can I narrow the Rectangle to only include the opaque parts and ignore the transparent surroundings?

kapep's answer is just what I want to do, but the problem is that the source is a Sprite, not a BitmapData object, and I don't have getColorBoundsRect() on a Sprite.

View 2 Replies

ActionScript 3.0 :: Draw Opaque Pixels On A Transparent Bitmapdata Background?

Oct 28, 2010

im trying to draw opaque pixels on a transparent bitmapdata background

heres the ex:

ActionScript Code:
//TRANSPARENT BACKGROUND
var _pixelColor:uint = 0x9998002E;
var _bmpd:BitmapData = new BitmapData(4, 7, true, 0x00333333);

[Code].....

This example paints 2 arrows, the first is using the transparent background, and the second is using an opaque background on the BitmapData.

What I'm trying to achieve is to paint the pixels of the arrow completely opaque on the transparent background. But as you can see, the pixel is at 99% of its opacity (var _pixelColor:uint = 0x9998002E) How can I paint 100% opaque pixels on a transparent BitmapData "canvas"?

View 1 Replies

ActionScript 3.0 :: Trim - Width And Height Are Not Effected By Transparent Pixels?

Feb 23, 2009

Is there a way to trim a bitmap so that the width and height are not effected by transparent pixels?

View 5 Replies

Get Rid Of The White Background Which Is Usually Transparent When Importing Custom Png?

Aug 1, 2009

have made graphics in paint, and i saved them under png.Now when i import them into flash CS4 the white backgrounds are solid? here is a photo of the problem: [URL]

View 4 Replies

Professional :: White Box Around Image In Transparent .swf File?

Feb 3, 2010

I created a .swf file for a header of a website using a logo that tweens in.  I tested the .swf with the transparent properties and it works but the logo I imported from photoshop has a white box around it, how can I remove this?  Do I need to import a transparent .png file instead of a .jpg?

View 3 Replies

ActionScript 3.0 :: Making Pixels With Bitmap?

Apr 16, 2010

i know i should probably be more specific here, but what my problem is that i want to make something were when mouse is button is pressed a pixzel is created. now i assume you use bitmap data setPixel function. but i don't know how to set it up so you can zoom in as well.me. i'm trying to set it up this way because i want to be able to save it as an image.because i tried it once before but after i had done all this i windedup not being able to save the image properly. it turned out having anti-aliasing around all the pixels.

View 3 Replies

ActionScript 3.0 :: Get All The Pixels Of A Certain Color From A Bitmap?

Aug 8, 2009

I'm looking for a way to get all of the black pixels from an image that I load in. This is in order to make all of those black pixels transparent.

View 4 Replies

ActionScript 3.0 :: Exchange Pixels In Bitmap With It From Another?

Nov 23, 2011

I got one bitmap with a (almost) one color background. i need to change all of this with pixels at same x,y from another bitmap.

I know i need to run it through a double for loop and then into an if sentence.

like this:

If (color at x,y is > redvalue && color at x,y is > greenvalue && color at x,y is > bluevalue)then exchange with pixel from the other bitmap.

View 1 Replies

ActionScript 2.0 :: Can Read Pixels From A Bitmap

Feb 2, 2005

does any one know if it is possible to pick out individual pixel values from a loaded image using actionscript.I am looking to to some sort of image to sound type of project. Where colours may effect the volume of different sound streams

View 5 Replies

ActionScript 3.0 :: Get Pixels Of Bitmap From Polygon?

Mar 20, 2011

I know that I can collect the pixels of a rectangular area within a Bitmap using getPixels(), but is there a way to collect the pixels of a polygonal area with more than 4 points? Or at least determine whether a particular pixel lies within a polygonal area of a Bitmap?

View 7 Replies

ActionScript 2.0 :: Read Pixels From A Bitmap?

Feb 2, 2005

does any one know if it is possible to pick out individual pixel values from a loaded image using actionscript.

I am looking to to some sort of image to sound type of project. Where colours may effect the volume of different sound streams

View 5 Replies

ActionScript 3.0 :: PNG Imported To Flash 5 Stage Is Transparent, Prints Out With A White Box?

Sep 20, 2011

I've got an application which gives the viewer the capability to create a design then further customize it with their own art, i.e. a logo, which can be a .jpg, .gif or .png. I may narrow the file options down, but right now I'm finding when one prints this design (I have a "print" button as well) any transparent .png file that's in this design prints out with a white "box" that is obviously the canvas on which said .png was designed.

View 2 Replies

Flex Tile List Transparent Image Showing With A White Background

Dec 29, 2011

I have a tile list that loads images from a folder within the app.

When i load images with a transparent background it gives the image a white background is there any way to get the image to be transparent? [coded]...

View 1 Replies

As3 :: Flex - Handling Inverted Pixels In BitmapData And Bitmap Class

Mar 29, 2010

I am using bitmapData and bitmap classes to render a mouse cursor on the display screen. The bitmapData consists of an area whose colors should be inverted according to the background color. This is a very basic thing which could be observed with text cursor(the vertical line with two small horizontals on top and bottom), when moved over the text area. want to be able to do the same with the pixels in my bitmapData, is there a way to find out the background color effectively and invert the color values? In this process i will be redrawing the whole pixels, is there any other efficient way to do that ?

View 1 Replies

ActionScript 1/2 :: Remove White In A Bitmap?

Jul 30, 2011

Is it possible to remove white in a bitmap in ActionScript2? If yes what commands are used and what's the procedure?

View 3 Replies

ActionScript 3.0 :: Remove White From Bitmap?

Jul 9, 2009

I was wondering if there was a way to remove the white space from an imported image using ActionScript 3?My ultimate aim is to be able to upload an image through flash (and .net) then load the image into flash and remove the white backgrounds.E.g. if your designing a t-shirt, and want to upload a logo, you would want to get rid of all the white that comes with your image around the edges to just leave the logo on the t-shirt.

View 8 Replies

ActionScript 3.0 :: Converting Textfield To Bitmap - Turns Into White Box?

Sep 22, 2009

I'm starting with a textField containing some bold white text.

If I add it to the stage directly it looks like it should look.

If I convert it to a bitmap, like this:

var bmd:BitmapData = new BitmapData(textfield.width, textfield.height);
bmd.draw(textfield);
var bm:Bitmap = new Bitmap(bmd);
addChild(bm);

Then I just get a white rectangle the same dimensions of the type.

View 2 Replies

ActionScript 3.0 :: Create An Effect That Will Tween The Bitmap From Black And White To Colour

Aug 24, 2009

I have a bitmap and it set to black and white using a colorMatrixFilter. Im trying to create an effect that will tween the bitmap from black and white to colour.

View 5 Replies







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