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


Similar Posts:


Actionscript 3 :: Quickly Rotate The Pixels That Make Up BitmapData Without Using BitmapData.draw()?

Dec 29, 2011

I've been using BitmapData.copyPixels() to draw graphics onto a canvas (Bitmap).I need to rotate the resulting graphics without the use of draw() because it's vastly slower.How can I rotate the target graphic? I'm assuming that there might be a formula or library that I can use which will first reorganize the pixels that make up a graphic based on an origin (point) and radians.I'm pretty certain that I'm not capable of creating such logic, so if there are any known libraries that do this, that would be awesome.I'd like to achieve something similar to XNA's SpriteBatch.Draw() method, which accepts rotation as its 5th argument.

View 3 Replies

Black Pixels Rendering When Publishing As PNG With Alpha?

Dec 14, 2009

When I publish as a PNG with Alpha there are black pixels that are rendered on the edge of the image near where the text is.If I remove the text from the image the black pixels do not render and the alpha looks as intended.

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

ActionScript 3.0 :: Create A Black Border Around The Opaque Pixels In Movie Clip?

Dec 14, 2010

I'd like to know if there is a way for me to someone create a 1px or 2px black border around only the opaque pixels in my movie clip?

I have a movie clip that has nested inside of it a Sprite that contains a graphic that was loaded up at runtime via Loader object. The graphic is a png image that contains parts of it as transparent.

View 3 Replies

ActionScript 3.0 :: Getting BitmapData With Masking Pixels?

Mar 9, 2011

I'm trying to create a BitmapData object from a movie clip, but I need to also get the pixel data in a layer that has been set as a mask in the authoring environment. All I'm getting is the masked in pixels, but I also need the mask itself, and I'm can't seem to find a way to do it.

View 2 Replies

ActionScript 3.0 :: BitmapData - Pixels Must Have Specified Gray Color Value

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

Actionscript 3 :: Removing Pixels Of One Color From A Bitmapdata?

Feb 24, 2012

I have a map (map of a mall, top view) with some colors. I´m removing the part for walking of the map, which has a type of color (say 0xcccccc).

I got all the 0xcccccc color pixels removed (setted to another color), but it seems to remain a bit of gray at the walking part.

The color of that bit it´s close to 0xcccccc. It looks like flash not succeeded while removing the walking part. But instead, leaved some parts (like borders or something) on the bitmapdata.

I´ve tried to remove by script, by picking the colors remained on the bitmap, but the loop doesn´t find these colors.

View 1 Replies

ActionScript 2.0 :: BitmapData Clear Pixels Or Set Alpha

Feb 26, 2008

What I have setup right now is one movieClip that is being used to be drawn into a BitmapData object. That bitmapData object is being drawn on the enterFrame and I am needing to clear it so it doesnt have the previous enterFrames information still stored in it, then once it is clear draw the current information. Is there a simple way to clear or erase all the pixel information in the BitmapData object?

If there is a way to set the alpha of the pixels I would really like to know how that is done as well. However, I want to change the alpha level of the entire BitmapData object, not just a few pixels.

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 :: BitmapData Copy Pixels Half Pixel?

Feb 17, 2012

Having trouble trying to scroll BitmapData on a half pixel here is my original code

var speed:Number = 1;
_bitmapData.copyPixels(_backgroundParallax, _screenRect, _zeroPoint, null, null, true);
_backgroundParallax.copyPixels(_backgroundParallax, new Rectangle(0, 0, speed, _backgroundParallax.height), new Point(_backgroundParallax.width-speed,0), null, null, false);
_backgroundParallax.scroll( (speed*-1) , 0);

which works until i change the var speed to .5, which is because .scroll method is expecting int's so i replicated what scroll is doing to try and allow .5 pixels

[Code]...

View 1 Replies

AS3 :: Flash - Inverse Black And White / Monochrome Bitmapdata?

Sep 23, 2011

I'm wondering if there are any nice ways of inversing a black and white / monochrome bitmapdata in AS3 which don't involve going through and setting each pixel by pixel?

View 2 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 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 :: 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

Can't Remove Black Bars When Converting?

Dec 21, 2009

I have seen numerous threads talking about Adobe Media Encoder producing black bars when converting videos.  Some are saying it's a bug w/ CS4, others are saying its something to do w/ non-square pixels.My dilema is, I have some .mov files created in Final Cut Pro with a 4:3 aspect in NTSC.  I need to convert them to .flv so I can stream them on a website.  My current settings are:
 
FLV - Web Large, PAL Source (I'm using PAL because it seemed to create a better quality video when I was streaming)

Export Video
Export Audio
On2 Codec[code]....
 
When I export the files and try to play them in a web flash player (480x400) I get black bars on the top and bottom.  I don't really have a lot of experience doing video editing so I'm shooting in the dark here.I have adjusted a lot of the pre-mentioned settings but still no luck. 

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

Remove Black Bottom Border On Embedded FLV File?

Apr 5, 2011

I have decided to embed FLV movie files into my HTML page that I have rendered from After Effects.

I have noticed that there is a black 1px bottom border on my FLV movie on my webpage. The FLV fits perfect on the space I have left on my webpage and border is 0 everywhere. I have checked the After Effects original file and there is no accidental space or background errors that might be causing it.how to remove the black bottom border?

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

Remove Black Bars On Long Side Of IPhone Video?

Feb 11, 2012

How do you remove the black bars on the long side of iPhone video? I'm converting video to .flv for a Dreamweaver site, and would like to trim the black bar that runs along the long sides of the video.

View 2 Replies

ActionScript 2.0 :: Remove Clip From Cache - Background Turns Black

Jun 26, 2009

I load this clip:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");
[Code] .....

In the last frame of my time line I add:
removeMovieClip("container_mc" );
The movie disappears but the placement turns black.
I added:
this._alpha = 0;
But the other clips of the main movie doesn't load.

View 1 Replies

Professional :: Remove The Thin Black Border Of Flash Movie When Viewed In A Browser?

Sep 23, 2010

There is a thin border at the top and left margins of my Flash movie when the .html is viewed in a browser. How can it be removed?Here's the movie.One solution suggests replacing some code, but the code they suggest replacing doesn't even exist in my html file.I have found questions similar to mine being asked all over different forums, but their solutions either don't work, or like the above, don't really apply. For such a common problem, finding the solution is getting a little frustrating.

View 1 Replies

Actionscript :: Remove A Filter From BitmapData?

May 27, 2011

I've added a black and white filter onto an image using the following code:

[Code]...

View 1 Replies

Actionscript 3 :: Remove Bitmap And BitmapData

Sep 11, 2011

How to remove the bitmap from the holder and the bitmapData from the Flash Player memory?[code]

View 2 Replies

Actionscript 3 :: Remove Similar Colors Of A BitmapData?

Jul 28, 2011

I was wondering if there is a filter or something in ActionScript 3 that lets me remove colors that are similar to other colors in a photo?

I have BitmapData of a JPEG image but the JPEG was saved with pretty low quality so there are some pixels that make it look ugly (JPEG artifacts). Without those pictures it would look okay, is there a way of removing them in AS3?

Was thinking something like a ColorMatrixFilter or similar?

View 1 Replies

ActionScript 3 :: How To Remove Or Update BitmapData For New Level

Jan 3, 2012

I'm making a maze game. The character can't walk through the walls of the maze (because of a collition detection between the bitmapdata from the character and the bmd from the walls). When the character arrives at a door, the next level/frame should appear with a new maze (new bounds). For the next level (next frame), I made a new maze with different walls. But the bitmapdata from the first maze is still 'active'.

So even though there's a new maze, the bitmapdata from the previous walls is invisible but still drawn on the stage. My question to you is: I want to change the bounds/maze every frame, how can I remove the previous bitmapdata so the character won't walk through the bounds of the next maze? Or is it possible to make an array from the different 'bounds'?

stop();
var isRight:Boolean=false;
var isLeft:Boolean=false;
var isUp:Boolean=false;
var isDown:Boolean=false;
var speed:int = 10;
[Code] .....

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







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