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


Similar Posts:


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 :: ColorMatrixFilter - Blending - Bitmaps - Fade Out The Pixels Each Frame And Then Add New Ones

Aug 29, 2009

Solved HERE: [URL] It's a mashup from two inspirations. Basically I'm using PV3D to add pixels to the scene everyframe and I have an BitmapEffectLayer handling their display. At the moment I am using a ColorMatrixFilter to fade out the pixels each frame and then add new ones. This is great but I also want additive blending (so when many pixels are on top of each other they turn white).

The original 2D version of this basically added the particles color to the original pixel color creating an additive blend. But I can't do that in 3D!!! Once the old pixels have been drawn they go to the BitmapEffectLayerand are rendered in 2D.. but I can go from 2D back to 3D again.. I hope I have explained my problem clearly.. also even if I could my skill doesn't permit me to do it..

View 3 Replies

ActionScript 3.0 :: Set A Color To Appear As Transparent For My Bitmaps?

Feb 19, 2009

How do I set a color to appear as transparent for my bitmaps?

View 13 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 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

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

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

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 :: Remove All Black Pixels From BitmapData?

Apr 19, 2010

Let say I have a BitmapData with different pixels representing an object, and some black pixels around it that I want to remove.I would like to obtain a new BitmapData, with width and height of the object represented by non-black pixels.For example, let say I have a BitmapData 400x400px, but the object represented by non-black pixels occupies the rect: x=100, y=100, width=200, height=200. I want to get new BitmapData representing that rect, all black pixels should be removed. Of course, i have no coordinates for that rectangle, i need somehow to make difference between a full black bitmapdata and the original one, and construct a new bitmapdata (different width and height).

View 1 Replies

ActionScript 3.0 :: Remove Particular Pixels From Png Or Moviclip Through Script?

Aug 9, 2010

For example I have a movieclip with two different pixels green and red. I need to remove only red pixels from that movieclip.

View 3 Replies

Flash :: Call An Update On The Entire Stage To Remove Any Pixels?

Oct 7, 2010

I have been using the evt.updateAfterEvent() whenever a mouse is clicked.Is it possible to call an update on the entire stage to remove any pixels.which are no longer being used?

View 2 Replies

ActionScript 3.0 :: How To Remove Transparent Part Of PNG

Apr 28, 2011

The background of the png images is transparent but is not actually transparent if I load the png with transparent background and add into a sprite. The transparent part also can receive the mouse event so I wanna know how can I remove these pixels?

View 5 Replies

ActionScript 3.0 :: Remove Transparent Area From Bitmap?

Sep 17, 2010

So I have a BitmapData object that's 400x400, and is mostly transparent with a small area (up to 50x50) of color somewhere inside. That's drawn to a bitmap, and now I somehow need to generate a Sprite that is only the dimensions of the small colored area, and sits in the same place on the screen.The size and position of the colored area is variable, and the operation to create the new Sprite must be near-instantaneous, so no lengthy pixel comparison exercises.

View 2 Replies

ActionScript 3.0 :: Comparing And Matching Bitmaps Against An Array Of Saved Bitmaps

Jul 31, 2009

I'm trying to figure out the best way to compare a single bitmap against perhaps an array of saved bitmaps to see how close of a match it may be to any one of the bitmaps stored in the array. Right now I'm running a for loop that uses the bitmapData.compare() method to try to compare to see how much of a variance there is but... to be honest I'm at a loss as to how to use the resulting data to do so. Does anyone know of any good method to accomplish what I am trying to do? Forget looking at my code it's a waste of time because simply, it's not working.

View 4 Replies

ActionScript 3.0 :: Transition Manager PixelDissolve - Instead Of The Pixels Being Dissolved The Pixels Being Added?

Mar 24, 2012

so instead of the pixels being dissolved, the pixels being added? :

ActionScript Code:
var Anim:TransitionManager = new TransitionManager(blackbox);
Anim.startTransition({type:PixelDissolve, direction:Transition.OUT, duration:1, easing:None.easeOut, xSections:35, ySections:35});

basically what i would like is the end point to be the start point and the start point the end point.

View 2 Replies

ActionScript 2.0 :: Slider Bars And Scaling - Code Keeps Shrinking Initial Object Down To 10 Pixels By 10 Pixels?

Jun 17, 2009

I have a swf file that loads into my main movie, and within that swf there is a masked image that i would like to scale using zoom in and out buttons and also by using a slider bar.However i cant find any tutorials that will allow me to combine the two.I have used the following code for the buttons. Which seems to work ok but i would like it to be a little smoother. (using speed or some sort of easing??)

ActionScript Code:
zoomPlus.onRelease = function(zoomIn) {
if (test_shirt.shirt._xscale == 400 && test_shirt.shirt._yscale == 400) {[code]....

but for this code it keeps shrinking my initial object down to 10 pixels by 10 pixels..

View 0 Replies

Actionscript 2.0 :: _y Movement By Pixels - Move The Movie Clip In Incremental Moves Consisting Of 30 Pixels?

Nov 18, 2009

I have a movie clip called column1_mc. when I click a button I need to move the movie clip in incremental moves consisting of 30 pixels.

column1_mc._y = 30;

Does not work because that is giving a _y coordinate.For example.I need to make the movie clip jump to _y 300 but make 10x30 pixel incremental jumps. Moving 10 times 30 pixel jumps.

View 1 Replies

Professional :: Transparent Background Is Not Working With Vmode Transparent?

Oct 17, 2010

I imported a video into flash and have a transparent photoshop layer to create an iPod skin. The video works fine, but I cannot get the "stage" to be transparent so that you do not see the flash background color behind the iPod skin.
 
I've read in the forums and have followed the instructions here from Adobe. If you look at my code, I have

[Code]...

View 6 Replies

Actionscript 3 :: Draw Transparent Graphics Onto Transparent BitmapData?

Feb 5, 2012

I'm trying to draw PNGs onto BitmapData that is transparent.

I create my BitmapData like this (using ARGB for the color):

new BitmapData(width, height, true, 0x00000000);

And clean it by using the same ARGB value:

bitmapData.fillRect(bitmapData.rect, 0x00000000);

When I use copyPixels() to draw graphics onto the cleaned BitmapData, I get this result:

If I don't use ARGB for the BitmapData color, it works fine:

But I have to specify a solid fillColor, meaning I can't render what's behind the Bitmap.

How can I make my BitmapData transparent, but not have the above occur?

View 1 Replies

ActionScript 3.0 :: Transparent Png Not Acting Very Transparent?

Oct 6, 2009

I have two png's that kind of look like paint brush strokes. they have some transparency in them that lets the stage colour bleed through a bit.

I am adding two of these images to the stage in AS 3. One adds quite fine - looks as expected. The second one however doesn't have any transparency other than around its edges. What i mean is it looks more like GIF than a PNG. Rough around the edges, no transparency "inside" the image itself (where there should be)

i have tried re-creating the image (yes it IS a PNG) which did nothing. I ensured the library item is not being treated as a JPEG. I also even tried externally calling the PNG to see if that made a difference. Unfortunately it did not.

why this second PNG doesn't seem to have a transparency set?

View 8 Replies

Carousel & Transparent Video - Add A Transparent Video In The Center

Oct 30, 2007

there are few comments i hear from other people. some say the axis of the carousel crooked and the icons are pixelated when they are scaled down. i m trying to add a transparent video of myself in the center but when i mask the carousel the embeded swf files also get the mask so i was wondering if there was a way to make the icons have alpha 0 when they are back all the way.. here s the link for the regular website [URL] and below is my actionscript

[Code]....

View 9 Replies

IDE :: Add Bitmaps By Using AddChild()

Jan 15, 2009

I have a movie clip that I add Bitmaps by using addChild(). I was wonding how would I go about displaying the next image that I added because as of now it is stuck on the first image.

View 3 Replies







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