Use Transparent BitmapData As A Mask?

Sep 15, 2010

I have a BitmapData object created dynamically that contains user-drawn shapes. I then attach that BitmapData object to a MovieClip via a Bitmap object and set that MovieClip as a mask to another MovieClip. The mask works but the whole bounding rectangle of the BitmapData is acting as the mask. But I want to exclude the transparent portion from the mask so only user-drawn shape can be set as mask. Can anyone tell how to achieve that?

View 3 Replies


Similar Posts:


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

Flex :: Make Transparent Color In BitmapData?

Jul 3, 2010

I have a code like this:

[Code]....

I want to make the white color in the generated PNG transparent.

View 1 Replies

ActionScript 3.0 :: Drawing A Transparent BitmapData Error

Mar 16, 2010

I have a huge background bitmapdata with a corresponding grid. I'm trying to draw the two parts onto a different bitmapdata, but for some reason, the bitmap for the grid is overriding the bitmapdata of the background that is being drawn first. The grid seems to be making the entire third bitmapdata transparent for some reason.

My code for creating the background and corresponding grid:

Code:
viewWidth=stage.stageWidth;
viewHeight=stage.stageHeight;
bmdScreen=new BitmapData(viewWidth,viewHeight,true);

[Code].....

I want to draw a grid on top of the background I have. For some reason, the grid is making the background underneath it transparent.

View 1 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 :: Detecting Percentage Of BitmapData That Is Transparent?

Jun 6, 2011

Is there any way of checking what percentage of the BitmapData is filled, and what percentage is transparent?You could easily brute-force it by looping through each pixel and counting which ones are empty

View 5 Replies

Use Semi-transparent Mask On External Swf?

Sep 12, 2009

I want to use semi-transparent mask on external swf for smooth transition. I'm using

clip.cacheAsBitmap = true;
mask.cacheAsBitmap = true;
clip.setMask(mask);[code].....

it doesn't work... what am I doing wrong?

View 7 Replies

ActionScript 2.0 :: Make The Mask Transparent?

Mar 9, 2006

I made a blind effect but when i play this effect it show the white strip on the clip which look's very bad. Is it possible to make the mask transparent so the background look same only the text is hidden omn which the effect is implemented.All of this thing are done in action script.

View 3 Replies

Actionscript 3 :: Bitmapdata - Make A Glow Around ONLY The Image In A Loaded Transparent PNG?

Nov 3, 2011

its possible to make a glow filter effect around ONLY the image in a loaded transparent PNG?

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

Professional :: Mask / Masking Using An Image With Transparent Bg?

May 30, 2010

Flash CS4 AS2 Okay -I have a flash movie, and I want to apply a mask to it.  The mask I want to apply, or rather, the "shape" of the mask I want to apply is an external image that was made in photoshop.  The shape is an irregular one with a bunch of jagged edges.  the shape itself is solid, with a transparent background.  I've tried saving it as a PNG with transparent b/g, and I've tried importing the PSD file directly into Flash - however  - when I go to use this shape for a mask, the mask that is applied is an entire rectangle bounding the imported image - rather than along the edges.Hopefully you can see what I'm trying to do here, and perhaps offer some insight on how I can get this image into flash (let's stick with the idea that the jagged edged manner of the image is too difficult to recreate inside of flash).

View 13 Replies

ActionScript 3.0 :: Copy Bitmapdata Ignoring Mask?

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

ActionScript 3.0 :: Circle Mask With BitmapData - Performance

May 17, 2011

I am looking for the most efficient way to create a circle mask on a BitmapData, so that everything inside the circle is visible and everything outside the circle is black. Here is my current code:

[Code]...

As the radius of this circle is going to be changing rapidly, storing the mask would be useless. how to make this more efficient, preferably keeping to methods that can use GPU accleration?

View 0 Replies

AS3 :: Mask Objects With Dynamic Transparent PNG Files In Flash?

Feb 7, 2012

i want to mask objects with dynamic transparent PNG files in Flash Action Script 3.0

View 1 Replies

Flex :: Draw Sprite Into Bitmapdata With A Strange Mask

Apr 14, 2009

I have run into strange behavior drawing a sprite into a BitmapData. This sprite looks fine when drawn directly to the screen. But when this sprite is drawn into a BitmapData, the sprite is being masked... but there is no such mask applied to that sprite! This "bad mask" can be toggled off and on... by applying / not-applying a different mask to the sprite I am drawing. This mask is not the same shape or location as the "bad mask".

[Code]...

View 1 Replies

ActionScript 3.0 :: Moment Of Brainfreeze - BitmapData With A Alpha Mask?

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

Actionscript 3 :: Bitmapdata.hittest Collisions With Opaque/transparent Png Files Imported With Loaders

Aug 27, 2010

I have two png files. I import them using loaders. The images in the png files each have opaque (solid) and transparent parts. I want to use the bitmapdata.hittest method to detect when their opaque parts have collided.

[Code]...

I've been working on this for a couple of days now and nobody seems to know how to do this. Please don't post the examples on google, I've looked through at least the first five pages of results on google and haven't gotten any of them to work. The problem is that none of them provide an example of using this method with loaders, so I'm guessing the reason I can't get it to work is some gimmick associated with them.

View 1 Replies

Actionscript 3 :: Get BitmapData From A DisplayObject Included Transparent Area, And Effect Area

Aug 5, 2011

I have this function:

public static function cloneDpObj(target:DisplayObject):Bitmap
{
var duplicate:Bitmap;

[code]....

to clone target displayObject (MovieClip or Sprite) and return Bitmap Object.

It can get bitmap from the target object, but it seem don't get all the area of the image.

By give the width and height of target object, but the target object in design was applied by Glow Effect, so my question can we get the all view of bitmapdata from a displayobject?

View 4 Replies

Flex :: Use Transparent Images To Mask Images And Add An Eventlistener?

Sep 2, 2009

the easy part is to create the image and the mask for it:

// The jpg
var elementImage:Image = new Image();
elementImage.source = "/assets/materials/9/main-body.jpg";

[Code].....

but that's not working here. the event listener reacts even if i hover over the trasparent parts.

if i draw an vector graphic and use it to mask the image it works just fine...

View 3 Replies

ActionScript 2.0 :: Flash 8 BitmapData - Getting Error : The Class Or Interface 'BitmapData.loadBitmap' Could Not Be Loaded?

Jan 31, 2007

I'm using Flash 8, with this code in the first frame:

import flash.display.BitmapData;
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;[code].....

When I publish the file, I'm getting the following error message in the Output panel:

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded.
var plaid:BitmapData.loadBitmap("plaid");

Total ActionScript Errors: 1 Reported Errors: 1

View 8 Replies

ActionScript 3.0 :: Error #2015: Invalid BitmapData At Flash.display::BitmapData()

Oct 14, 2009

I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source .html" but I keep getting this error:
 
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData()
at Reflect()
at Site_fla::GalleryPage_29/loadThumbs()
at Site_fla::GalleryPage_29/sortXML()

[Code]...

btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection..

View 10 Replies

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

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.0 :: BitmapData.hitTest - What Angle Or Coordinate Of The BitmapData The Collision Happens?

Sep 1, 2011

how to use the bitmapData collision method. Now I'm trying to figure out if there is a way to see at what angle or coordinate of the bitmapData the collision happens? I need it in order to figure the accurate bounce angle after the collision occurs.

View 2 Replies

Flex :: AddChild A BitmapData Or Draw A BitmapData To Screen?

Jul 15, 2009

I'm currently working on a flash game and I need to know how to addChild a BitmapData or draw a BitmapData to screen. If I can't than how can I give a DisplayObject my BitmapData?

View 2 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 :: BitmapData = New BitmapData(); Eating Up Memory?

Dec 22, 2011

I've made a mobile version of my software, with low-res images and such, and I can now fully buffer all my content (including a 360 frame animation which is buffered to memory). Problem is, that everytime I update the view, more memory is used.When I write image = new BitmapData();, does it store the previously created BitmapData's in memory? Do I have to flush the memory somehow before I draw my second picture in BitmapData?Example:

ActionScript Code:
// In this example I draw using the same bitmapData several times, also
//overwriting the first image. Do I have to somehow delete the data first, to

[code].....

View 1 Replies

ActionScript 3.0 :: Alpha Mask - Area Of The Loader Outside Of The Mask Will Visible When The Mouse Is Down

Sep 10, 2010

I have a startDrag function set up on a loader and mask that when the mouse is down on the loader it drags, when not it doesn't. There is also 2 buttons that control whether mask1 or mask2 is used. What i would like however is when the mouse is down - the area of the loader outside of the mask is visible but only by about 10/20% alpha, that way the user can see where all the image is while dragging. Is this possible? Full code can be seen below and i have attached the zip with the .fla file:

[Code]...

View 2 Replies

ActionScript 2.0 :: Scriptable Mask - Large Mask Behind The Whole Of Flash Site?

Aug 19, 2003

what i am doing is to make something along the lines of the "scriptable mask" tutorial Inigo was kind enough to put up.My idea is to have a large mask behind the whole of my flash site, this masks a colour image with a black & white one (nothing tricky). The image I am using is actually 5 separate images combined, and each is a pic of certain parts of the site.I also have a very basic set of buttons along the bottom... each corresponding to each section.

All I want is to set it up so that when I mouse over the buttons, the _x of the mask moves to correspond with the correct image... really very basic... or so I thought .If anything it should be easier to do than what is in Inigo's tut (where he uses the _x of the mouse to move the mask)... i just cant seem to get it to work with a nice easing effect (its easy to get the mask to simply snap to each coordinate, but I need it to smoothly move).

View 4 Replies







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