ActionScript 3.0 :: Crop Bitmapdata To Create New Bitmap

Oct 29, 2008

I want to be able to crop an image based on what is viewable through the mask and then saved that cropped image out to a new file. I'm not exactly sure how to do this though

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Crop A Bitmap In Runtime?

Jul 26, 2010

Is it possible to crop a bitmap in runtime using AS3

View 1 Replies

ActionScript 3.0 :: Crop Bitmap Along Path?

Aug 17, 2009

Im working on this project where I get a stream and eventually a bitmap from a webcam. Right now I'm kind of stuck trying to crop a subset from theis bitmap along a path of x,y coordinates. The path will always contain four corners, but these are not necessarily 90 degrees, so It is usually a somewhat skewed square. what classes to use for a custom crop ( not really keen to make one fresh)

View 7 Replies

ActionScript 3.0 :: Any Way To Crop Bitmap Data?

Mar 1, 2009

Is there any easy way to crop my BitmapData without converting it to Bitmap (I only want the first 300x200 pixels).

View 9 Replies

ActionScript 3.0 :: Bitmapdata.hitTest - Bitmap 'emptyBitmap' With Bitmap Data Created

Feb 3, 2009

I'm cutting my teeth in actionscript 3 on a game that has a character running through a world. So, I have set up my Hit Testing by using the bitmap data hit test method, since I figured my world is going to be destructible - it'd be nice to update the level and then redraw it and have the character interact with the new change. (That works beautifully) I am however; a bit confused as to how I have my hit Testing set up. I've been messing around with it, and it works for now - but I'm not sure why.. currently, I have a character set up by using a class I built and using a series of animations I created. So, this character has a walking and falling animation, etc. This is a movie clip.

Then there's a bitmap 'emptyBitmap' with bitmap data created - however; I never really added this as a child to the character. This is sized to the dimensions of my character. My level is created as a movielip, then it's drawn to a bitmap - when the level movieclip is changed, the bitmap redraws, and that's how this updates.

[Code]....

View 1 Replies

ActionScript 3.0 :: Use The BitmapData Property Of A Bitmap And Pass It To The Constructor Of A New Bitmap Object?

Aug 20, 2009

I know the topic of "duplicating" movieclips is a hot issue with the new virtual machine. Luckily, I understand the implications. I only am [currently] interested in duplicating a Bitmap. See, I load an image from an URL using 'flash.display.Loader.load', which is a non-blocking operation in Flash Player.However,I may use multiple copies of the loaded image (which is reported to be a Bitmap, naturally) in the display list at the same time.Hence, I naturally do not want to load the image from an URL every time, because I don't want to wait for a non-blocking call to complete. Nor do I need to - I mean one copy is already loaded, so it should be possible to just "duplicate" it, right?

My idea is to do use the bitmapData property of a Bitmap and pass it to the constructor of a new Bitmap object. I have not tried the following in action, but I want to hear whether any of you did and if the following would not work, what would:

Code:

var original_bitmap: Bitmap;
var copy_of_original_bitmap: Bitmap = new Bitmap(original_bitmap.bitmapData);

LiveDocs mention that the BitmapData being passed to a Bitmap constructor is "being referenced", which to me might suggest it cannot be used twice? There is also the BitmapData::clone() method, which I am not sure is applicable here or not.I know this is a lot of talk instead of just trying this out, but I test so much Flash Player code daily just to see "what works" (which should be documented instead by Adobe),

View 4 Replies

ActionScript 3.0 :: Loading Image Into Bitmap And Crop It With Rectangle

Jul 31, 2010

I just started working with bitmaps and I do not get them at all, I've read the entire page adobe has on bitmap and bitmapdata. I've got this code together but all it does is displays a white rectangle and not my image.

ActionScript Code:
package {
import flash.display.MovieClip;
import flash.display.Loader;
import flash.display.Bitmap;
import flash.display.BitmapData;

This code should load the image into the bitmap (which works), then crop it with the rectangle (which just crops the fill from the bitmapdata)

View 6 Replies

Actionscript 3 :: Bitmap Crop With Feathered Edges (blur Edges)?

Mar 11, 2011

I have been trying to figure out a good strategy to perform a bitmap crop using Actionscript3. For example: I have a picture of a car and I want to crop out the car from the image alone and feather the edges so that they do not look jagged.

I am a flash noob and have only been using it for a couple of weeks. I've tried a couple of options and here is the last one that I have come up with it: I place red dots on stage that are draggable so that you can outline the object you want to crop and the dots are the bounds for a gradientFill that is used as the bitmap's mask. (I am using a radial gradient ... so the results are far from what I want, since the car is not an oval).

[Code]...

1) How can I fade just the edges of this custom-shaped fill outlined by the red dots?

2) I want to save the image out to a file once it's cropped. What strategy would be better for doing this using a BitmapFill or a GradientFill as a Mask (If it's possible with both)?

3) I may be using this strategy to crop faces later on.. anyone know of any good face detection APIs for as3? (also edge detection APIs)

View 1 Replies

Professional :: Crop A SWF Like Crop An Image In Photoshop?

Nov 3, 2010

Does anyone know a way to crop a SWF like you would crop an image in Photoshop? I'm building a Flash Banners application in my Flash portfolio website and I'm loading a SWF using addChild via a URL loader object. There is no way to mask the outsides of the SWF because addChild puts the SWF at the front of the display list so the masks would just show up anyway and the masks will just be huge white sheets that will look dreadful. I need to LITERALLY crop the SWF down to 550 X 325 pixels.

View 5 Replies

ActionScript 3.0 :: Cut Bitmap In Bitmapdata?

Sep 14, 2010

I need how to cut bitmap from bitmapdata.

View 2 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.0 :: Encoding Bitmap (bitmapdata) To JPG

Aug 27, 2010

i'm writing simple image editor. I want to allow user to change contrast, brightness ect and save file as jpg. I got 2 problems.

1. I apply filters to bitmap and when I save it, it saves only original image without filters.

ActionScript Code:
var bitmapData:BitmapData = Bitmap(source_image.content).bitmapData;
var bmp:Bitmap = new Bitmap(bitmapData);
bmp.filters = combineFilters();
combineFilters function gives a set of ColorMatrixFilters to change contrast and other stuff.

2. When I encode a JPG with a as3corelibrary it makes it very slow (over 20 sec for img) and freezes app. Is there any way to aviod this?

View 0 Replies

ActionScript 3.0 :: Drawing BitmapData To Bitmap?

May 8, 2009

what i need to do is basically a motion trail on a bitmap.

I want to continuously draw a bitmap onto itself while previous versions are faded into the background, similar to a smoke type effect.

View 1 Replies

Flex :: Get Notified Of Change In Bitmap / BitmapData?

Sep 29, 2010

In Flex, how does one hook into a bitmap or bitmapdata variable so that a function is notified whenever the bitmap's data has changed (pixel has changed, or filter's been added)?

There must be a way to do it, because I can bind an mx:Image to a bitmap via the 'source' attribute, and the displayed image updates all the time when a I modify the bitmap. How does flex do it? Does it blindly redraw the bitmap at every frame, or is it smart and only redraws when the bitmap changes? If so, how does it know when the bitmap changes?

View 1 Replies

Flash :: Show A Bitmap Which Is Only A Portion Of Its BitmapData In AS3?

May 14, 2011

I am writing a screen scroller for a game I'm making. There's a BitmapData object which holds the background graphic, yet I do not want to show/render it on screen all at once.

For example, I want to show only a 500x500 section of the data but the entire BitmapData is 1000x1000. I wanted to use the scroll() method to scroll the data but my problem is that I cannot restrict how much of the BitmapData is drawn on the Bitmap. I tried setting the height/width properties of the BitmapData to 500x500 (and draw all the 1000x1000), but any data drawn beyond the boundaries I defined is not really drawn.

Another option I considered is to store a different BitmapData object which holds the entire data, and then use copyPixels() from it to the one used on the Bitmap itself, although then I cannot use scroll() and have to use different methods to achieve scrolling.

View 4 Replies

ActionScript 3.0 :: Extract Bitmap Or BitmapData From MovieClip?

Jun 28, 2007

I've been looking for a solution for hours now. I have a movieclip which contains an image. Created by doing: put image on stage, convert to symbol, movieclip type, ok.I'd like to extract this bitmap because I want to use (somewhere else): graphics.begintBitmapFill(); but this method needs a BitmapData object and not a movieclip to create a repeating background (in my case).

So: how do I extract the Bitmap or the Bitmap data from a MovieClip?mind that attaching BitmapData as a base class to this symbol is NOT AN OPTION

View 11 Replies

ActionScript 3.0 :: Load It Into BitmapData Then Into Bitmap Then Onto The Stage?

Jul 16, 2010

What i want to do is get a png from my library load it into bitmapData then into bitmap then onto the stage.I don't even have enough success here yet to have code to post. Please for the LOVE of Mike!

View 5 Replies

Flex :: Creating Dynamic Class For Bitmap Containing BitmapData From SWC?

Jun 1, 2011

I have the following code

///Get BitmapData from library in SWC
var ClassReference:Class = getDefinitionByName(products[i].producticon+"Data") as Class;
// Create new BitmapData Instance From it

[Code]....

I get null in the trace. How do I make a dynamic class that I can refer to for this bitmap similar to how your reference a class from and embedded media?

View 1 Replies

Flash :: Load A Bitmap File Into A BitmapData Object?

Mar 31, 2009

In Flash, the BitmapData object can be used to store bitmaps in RAM, you can later draw them to a MovieClip using the beginBitmapFill() method.

How do you load an external bitmap file (.jpg) into a BitmapData object?

View 5 Replies

ActionScript 3.0 :: Add Loaded Bitmap Or BitmapData To Papervision 3D Project?

Dec 22, 2009

I have a class that loads an image and offers you the ability to have it in a bitmap or bitmap data object available after the image has loaded. But when I try this:

[Code]....

View 2 Replies

ActionScript 3.0 :: Bitmap Width Change Not Reflected In BitmapData?

Feb 17, 2010

I have a small bitmap, and it's one that's going to be scaled to be much larger then added to another bitmap. So I have the bitmap and I changed to width to make it larger, then when I use copyPixels to place this bitmap onto the main bitmap the image added is the original bitmap, not with the width changed. How can I make it reflect the changes?

View 3 Replies

ActionScript 3.0 :: Does BitmapData.dispose() Remove Memory Occupied By Its Bitmap

Mar 1, 2010

1: I upload an image

2: Without altering it,I make a copy of it and use it display to users in resized format

note: I won't display the original image.

3:Now when user deletes the resized image,i need to delete the image loaded as bitmap i.e. the original image which i won't be displaying

For that I used bitmap.bitmapData.dispose() method.But,it doesn't free up the memory taken by the bitmap.For instance at initial state the memory usage is 58 Mb and upon loading 3 images the size increases to 87 Mb.And when I delete all the images the size decreases to 81 MB only.

View 6 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 :: 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 :: BitmapData.dispose() Remove Memory Occupied By Its Bitmap

Jun 6, 2010

This is my scenario

1: I upload an image

2: Without altering it,I make a copy of it and use it display to users in resized format
note: I won't display the original image.

3:Now when user deletes the resized image,i need to delete the image loaded as bitmap i.e. the original image which i won't be displaying

For that I used bitmap.bitmapData.dispose() method.But,it doesn't free up the memory taken by the bitmap.For instance at initial state the memory usage is 58 Mb and upon loading 3 images the size increases to 87 Mb.And when I delete all the images the size decreases to 81 MB only.I feel the loaded bitmap is not completely removed.

View 9 Replies

Flash :: Search BitmapData Object For Matching Pixel Values From Another Bitmap?

Jun 16, 2010

Using Actionscript 3 is there a way to search one bitmap for the coordinates matching pixels of another bitmap?

[URL]

Somehow you would have to loop through the bigger bitmap to find and the the pixel range that matches and return those coordinates. For example the Bitmap with the "E" is 250 pixels over and 14 pixels down in the bigger bitmap.

View 2 Replies

ActionScript 2.0 :: BitmapData And Transformation Matrices - Shift The Newly Created Bitmap?

Jan 29, 2007

I've started getting to grips with using the BitmapData class and a Transformation Matrix in the hope that I can start making some interesting image effects. However, at the moment Im having trouble figuring out how to shift the newly created bitmap so that any scale transformations are applied from the center rather than the top left corner. See here for example: [URL] The flower on the left is the original, the flower on the right is the new image created using "bitmapData.draw()". It has been scaled up to twice the size, but I want this to happen from the center of the image.

[Code]...

View 5 Replies

ActionScript 3.0 :: Writing Directly Into Bitmapdata Cause Flash To Refresh Bitmap In Case Of CacheAsBitmap

Dec 26, 2011

So if i have a bitmap in a mc that doesnt animate (because i write directly into the bitmapdata) can i use CACHEASBITMAP?

View 3 Replies

Flash :: Find The Size Of The Area In A Bitmap Which Has Been Filled Using The Bitmapdata.floodfill Method?

Sep 27, 2011

I am using the floodfill method to colour-in sections of a bitmap image. That part is easy enough but the issue comes in with the way I am adding an effect to the colour fill routine.

To add the effect, first a copy of the bitmap data is created and floodfill is used on that instead of the original bitmap. Then the bitmapdata.compare method is used to set the alpha value of everything apart from the filled-in section to 0 and the result is saved in another bitmapdata. After that, a 1 px radius circle sprite is added to the stage and is being tweened to the image dimensions and its mask is set to the sprite which contains the result of the compare operation.

This works perfectly except for the fact that the fill sprite has to be tweened to the complete image dimensions irrespective of how small the area is being coloured-in since I am not able to find a way to get the dimensions of the fill area. I am doing an bitmap image update at the end of the tween and I have to disable user interaction till the tween is complete to avoid the errors which come in if another fill-in operation is started before the base image has been updated. If I could somehow get the dimensions of the fill area then the time during which I have to disable the user interaction will go down considerably.

View 3 Replies

Actionscript 3 :: Create A Bitmap From Another Bitmap?

Feb 24, 2012

Letīs say I have a bitmap with 3 colors: red, green and blue (not mixed)

What if I wanted to make a bitmap of the red part of the first bitmap?

Iīd like to take the red pixels from first bitmap (and its positions), and make another bitmap.

View 2 Replies







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