ActionScript 3.0 :: Copy A MovieClip With Filters And Alpha To Bitmapdata?
Jan 19, 2011
I have a movieclip with an image that has transparency and filters applied to the movieclip.I know I can use "draw" to copy the movieclip to a bitmapdata object, but it doesn't seem to copy the filters and the transparency of the image. How can I copy these so the bitmapdata matches the original movieclip in appearance?
View 5 Replies
Similar Posts:
Apr 16, 2007
I try to make a simple copy of a flv video in a new MovieClip using the BitmapData class.
Here is my code :
Code:
var video1:MovieClip = this.attachMovie("mcVideo","videoMC",1);
var objVideo = video1.v;
var _nc:NetConnection = new NetConnection();
[Code]......
View 6 Replies
Apr 15, 2009
I have an MC that I'm using TweenMax to manipulate filters on. I want to alpha the clip to 0 but have the outerglow remain, almost like a stroke, how this can be done, inside the mc is a PNG, so really I'm trying to create a dynamic stroke around the non - transparent portion of the PNG.
View 1 Replies
Sep 3, 2010
How can I copy or duplicate the bitmapdata from a mx:image component?
I need to display the same image in multiple screens of my application and don't want to have to download the image multiple times.
I could just use a urlrequest to download the image as a bitmap and copy that but I like the way you can can just set the source of the image component.
View 2 Replies
Apr 6, 2011
For the class spark.components.Image
I can access the bitmapData object (readonly) (unscaled). I know the scaling factors of the Image.
How can I get a scaled version of the bitmapData?
View 3 Replies
Aug 30, 2011
I'm trying to copy the bitmapdata of a movieclip in which i have a mask. And it copies by ignoring the mask. It's there a way to make it copy what i see (including the mask applied)?
View 7 Replies
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
Apr 14, 2009
I am trying to make a flash file that has wmode=transparent that takes up 100% width and height of the browser. I need to take a copy of the contents underneath the flash (the HTML page its floated over) and use that BitmapData to manipulate the content visually.
View 2 Replies
May 3, 2011
I am developing an application similar to MS Paint. I am building a Flash Paint application. The basic structure is this. I have two layers namely topLayer_mc and bottomLayer_mc. The actual vector drawing is drawn on the top layer and onmouseUp of the tool, a bitmap copy of the vector graphics on the top layer is taken and added as a bitmap to the bottom layer. The top layer is cleared subsequently. It is working for the pencil tool.
Now I need to create an eraser tool. This is where things get tricky. In the application there is an option to save the image as png, so alpha has top be preserved. So the coventional method of draw a brush using the vector and using the draw method of bitmap will not work. Of course, on a visual level it would work if the brush drawn using the vector is to have the same color as that of the background. The eraser's are rectangular in shape.
The technique I am tring to use is to use the copyChannel method of BitmapData class. Specify a channels (say GREEN channel )hex value as 00 and make it as the source. Then make the destination channel ALPHA. I got it working without using movieclips as shown below.
[Code]....
View 1 Replies
Dec 1, 2009
I'm making a copy of a Sprite via the BitmapData Draw method. It kind of works other than the top portion of the bitmap gets cut off (replaced with transparent pixels). It looks like it's about the same height as the Sprite's y value.
looks like this:
_________________________
| |
| TRANSPARENT PIXELS |
|_________________________|
| |
| IMAGE |
| |
| |
| |
| |
| |
| |
|_________________________|
View 5 Replies
Jan 11, 2010
I'm blitting a map onto the screen with tiles.. and the source of these tiles are BitmapData objects.I know you can change the alpha of a bitmap.. but I'm not too sure if it can be done on the BitmapData object itself.I want some tiles to have less alpha than others. Applying the alpha to the Bitmap.. makes everything on the current screen have an alpha.. but I only need one tile of it..
View 4 Replies
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
Aug 22, 2011
i have the following situation:
one drawing layer (graphics object with lineTo, etc.)
one png with an alpha channel (supposed to serve only as a mask)
now i want to be able to only draw lines within an area restricted by the png mask.
i am trying like this:
var bitmapData:BitmapData = new BitmapData( 320, 320 );
bitmapData.draw( drawingLayer );
bitmapData.copyChannel( maskBitmapData, new Rectangle( 0, 0, 320, 320 ), new Point( 0, 0 ), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA );
now the borders get cut off fine, but i get a black background, since the drawing layer has an alpha between the drawn lines (and it should remain like this) and the mask bitmap has an alpha outside the shape. so naturally the mask's alpha replaces the drawing layer's.
i tried it with merge, copyPixels and also with just setting the mask property on the drawing layer (i set everything to cacheAsBitmap) but to no avail.
ADDITION:
when trying to use a mask i tried it with
<s:BitmapImage id="mask" source="@Embed(source='...')" cacheAsBitmap="true" />
and also as
[Embed("...")]
private const BodyMask:Class;
var maskBitmap:Bitmap = new BodyMask();
and assigned them to the mask property of a s:Group element (cacheAsBitmap=true) where the operations on the graphics object occured. i also tried reassigning the mask after each draw operation.
View 1 Replies
Mar 15, 2011
If my title ain't clear enough, I've got two bitmapData sheets with an image, one being the actual image, and the other image having the same structure, but all areas being visible are black, and all transparent areas being completely white. So far I've been playing around with:
[Code]....
View 5 Replies
Oct 23, 2010
[URL] i want the object to fade out but in the object there's a lot of overlapping pictures and each becomes half transparent. how to make the movieclip to change the alpha as it was without objects?
[Code]....
View 2 Replies
Oct 14, 2010
I'm looking for the most efficient possible way of drawing an 8 x 4 grid (960x600 total size). Each square of the grid has a variable alpha and the grid is redrawn every enter frame. The problem is my application is doing a lot already and I'm looking for the most efficient way to execute this loop 32 times (possible more in fact) per frame without overloading processor.
Code:
private function init():void {
var dimensions : Array = [ 0, 0, 960, 600 ];
var gridRaw : Array = [ 8, 4 ];
var stageRect : Rectangle = new Rectangle( Number( dimensions[0] ), Number( dimensions[1] ), Number( dimensions[2] ), Number( dimensions[3] ) );
[Code] .....
I'm under the impression there could be better ways of drawing the shapes straight to BitmapData without using Sprites, or maybe I'm doing something wrong about memory usage as I can see memory going up and down in a cycle.
View 5 Replies
Mar 17, 2011
I am drawing a flash sprite on a BitmapData using its draw() method. This sprite has some nested objects with 0 alpha, yet the draw() method draws them on the bitmap data.
I think it has to do with the color transform I am using, but I have no idea how to change it to achieve the effect I want.
The color transform is the following:
Code:
new ColorTransform(1, 1, 1, 1, 255, 255, 255, 255);
I am using these values in order for the Bitmap to have white pixels wherever the object was, and black where there is nothing. The draw() also draws my alpha = 0 objects in white as well.
View 1 Replies
Jun 10, 2010
if my code is
Code: Select allvar mcFilters:Array = new Array();
mcFilters = mc.filters;
mcFilters.push(new GlowFilter());
[code]....
View 4 Replies
Mar 11, 2009
i just ran into something i've never thought about.I want create a bitmap from a movieclip. Nothing special by now,but when this movieclip has some filters added, then they will be ignored, and thats what i dont want.I tried to copy the movieclip into another movieclip and then make a bitmap from its parent, but no luck there either (or i made something wrong), still no filters visible.
View 2 Replies
Jun 7, 2010
Im interested in red glow effect, no applaying, instead of it i want adding filters, only for my mc.on click, i know to add event listener
View 7 Replies
Mar 5, 2010
can i tween dynamically a movieclip with a change in filters used(as the property parameter in tween). I want to work on blur filter for a movieclip with AS3.0
View 1 Replies
May 15, 2011
For my project I need to copy the graphics of a Movieclip with all of its children without copying anything else into a second Movieclip. I cannot use the Bitmap classes because I need the graphics to be displayed as a vector and I cannot use a method that simply copies the clip by calling the instructor ie:
var copy:MovieClip = clip.constructor. Is there any way to copy only the display portions of a clip into another Movieclip without turning it into a bitmap?
View 1 Replies
Mar 6, 2012
I'm making a side-scrolling game, with a (theoretically) infinite background. I have a block engine that places the blocks on the bitmap canvas. Now here's the catch. I'm using the bitmapData.scroll() function. Now unless I clear the screen each time the character moves, it's going to leave ghost images of the border of the screen, like this picture: zanzlanz. tumblr. com/post/18857712784 If I clear the screen each time, then it generates a lot of lag (because it has to repaint the objects again). I'm a bit lost on how I can scroll without leaving streaks of the side of the screen and without repainting the entire screen.
View 1 Replies
Jun 22, 2011
I've written a simple MovieClip replacement that converts an existing imported MovieClip to a sequence of BitmapData. This removes the requirement for Flash to render vector data in the MovieClip on each frame.
But BitmapData has a huge memory footprint. I've tried converting the BitmapData to a ByteArray and using the compress() method. This results in a significantly smaller memory footprint. But it has proven impractical. For each redraw, I tried uncompressing()'ing the ByteArray, then using SetPixels to blit the data to the screen, then re-compressing() the frame. This works but is terribly slow.
So I was wondering if anybody else has an approach I could try. In Flash, is it possible to compress bitmap data in memory and quickly blit it to the screen?
I wonder how native animated GIFs work in Flash. Does it uncompress them to BitmapData behind the scenes, or is frame decompression done on the fly?
View 1 Replies
Aug 2, 2011
i have two movieclips container.
MovieClip_1
MovieClip_2
now MovieClip_1 contains one child _child_1. now by pressing button i want to add that _child_1 of MovieClip_1 to MovieClip_2 without removing from MovieClip_1.
i tried following code in button press event but it removes _child_1 from its past container.
var mc:MovieClip = MovieClip(MovieClip_1.getChildAt(0));
MovieClip_2.addChild(mc);
View 2 Replies
Jul 29, 2009
when I have one movieclip mc1, mc2 is child movieclip in mc1. How can i copy mc1 to mc1_1 with all children movieclip ? if i use attachMovie or duplicateMovieClip, i only copy mc1 without mc2.
View 3 Replies
Jan 9, 2010
Is there a way (in AS2) to copy a layer into movieclip?
View 2 Replies
Jun 17, 2010
How does one select layers then bring them into a new MovieClip with their artwork and functionality etc intact.
I have a load of layers which together form a map with animations that run on it. A static key with a few buttons runs the animations on the map. I need to pan/zoom this map and as such need to package all these layers that form the map up into something that can be referred to in the coding for the pan and zoom functions.
I created a new layer in my timeline, called it MapPanZoom, then went Insert>new>movieClip.
I now need to remove the maps layers from the timeline and into the timeline for the movieClip I just created. How is this done ?
Leaves behind the static key that sits outside of the map, when a button in the key is clicked, I hope to see it run the animation on the map, and have a user able to zoom and pan the map whilst it runs.
I tried selecting the layers then edit>copy, then opening MapPanZoom movieClip from Library and edit>paste, nothing happened. Planned to delete the layers if it had worked out of the original scene1.
View 1 Replies
Oct 1, 2009
I know there are a million and one posts about how to copy a MovieClip object, and I'm fully familiar with the method of[code]...
For this reason I can't use the original.constructor job as flash obviously thinks it's a straight MovieClip, so I just get an empty MovieClip. So far I've been getting by with creating a Bitmap, but in future these swfs will contain animations too.
View 9 Replies
Mar 5, 2009
I have a question: I want to duplicate a movieclip 10 times, with different variable names. So they are named: Main1, Main2, Main3, etc
View 1 Replies