Flash :: Using Bitmap Data To Draw Massive Image?

Feb 18, 2011

I am making a snow boarding game in AS3. The problem I am having is that I want to leave a trail in the snow behind the board.

I have had a think and feel that the best way of achieving this would be to use the lineTo() method to draw a line form the snowboards previous position to its current position. If I do this all of the way down the slope I would end up with a line almost 23000 pixels long which seems extremely large and will have a major impact on performance.

If I were to convert the trail movieclip to a bitmap would it improve performance? I am targeting a minimum of flash player 9 which I have found to have issues when handling bmp's over 2880 pixels so I think this method might not work.

View 2 Replies


Similar Posts:


Flash :: Bitmap Data .draw() With Transform Matrix

Jun 29, 2011

I'm working on a project wherein a user can take a snapshot of themselves using their webcam and then edit this image by transforming scale and rotation and save the result.

I've got most of it working, the user can take a snapshot of themselves, transform the object using Senocular's Transform Tool and i'm using .draw() to then save this transformed object. The problem is .draw() is only grabbing data from the top left corner of the stage. It is drawing the transformed object but only from the top left corner.

Why does it only draw from the top left corner and how can i get set the coordinates to only draw from the area where the captured image is set?

You can view the file as is at: [URL]

And i've zipped the FLA and relevant classes at [URL]

import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;

[Code]....

View 2 Replies

ActionScript 1/2 :: Bitmap Data Can't Draw MC With FLV

Aug 1, 2010

I've created a prototype that will copy the pixel data from a movie clip then create a JPG image from it via PHP. It works perfectly. But when the MovieClip (called mcImage) contains a Video Object loaded with a streamed FLV, it won't copy the pixel data to the Bitmap object. The image generated is white. Here's a sample code:
 
var oBitmap:BitmapData = new BitmapData(nW, nH, true);
var oMatrix = new Matrix();
var oColorTrans:ColorTransform = new ColorTransform();

[Code].....

View 4 Replies

ActionScript 3.0 :: Draw A Bitmap - Store Data?

Feb 10, 2012

How fast can I draw a bitmap? (60 htz = 60 fps right? That's what I need)Does player's visual stay in sync with the refresh rate of the monitor? I mean if I had multiple threads running in the backround but Flashplayer's priority to High would it not be interrupted (choppy)?

Do event listeners work when the user's focus is on another application? (say voice chat for example. Hit a key and BOOM. You speak. But if the user is tapped out would it pick up? Can I make an actual SAFE place I can store data? I mean, does the FileSystem have any tricks that allows only the application requesting the file to read it? I mean there's "locking" but can't all files can be unlocked? Even if they can't it doesn't take a pro to scan for all files on the system..An undetectable file

Do bitwise operations work at the same speed on all compilers? Does anyone know where that GreenThread build went? I had a good one a while ago but deleted a lot of things in confusion (in order to get that "start fresh" feeling...recovering all files as we speak) Speaking of recovering, how does File Recovery work? I hear it scans the hd sectors for file headers and pieces them together. I would like to make one (instead of using the one I have now) Is this the MAIN forum for as3? I've only been to this and flash develop (though I hear stackoverflow is good too?)

[Code]...

View 8 Replies

ActionScript 3.0 :: Resize Bitmap Data After Draw

Mar 1, 2012

So I am working on this project for work and we have a bunch of sprites with transform matrix that contain the rotation, scale, x, and y coordinates of various parts of a character, i.e arms, legs etc. so we are then drawing the individual sprites onto the same bitmap data. Then we store it in a vector and display it later.

The problem is the models are too big. So I want to resize them, without having to rebuild the entire matrix, since I don't want to go through every matrix in the sprites and manual calculate the scale, rotation, x, and y after it has been made samller. Is there a easy way to do this? To resize the bitmap data and maintain the data that is already set up to construct the model? I can't share the code but the psuedo code is: we create a bitmapdata of a specific width and hight.

We the loop through all the children of a wrapper sprite and do a bitmapData.draw of each of the children and use their matrix for the second param, and then have it build to the bitmap.rect.

View 2 Replies

Actionscript 3.0 :: Bitmap Data .draw() With Transform Matrix

Jun 29, 2011

Long time since i've been on here. I'm working on a project wherein a user can take a snapshot of themselves using their webcam and then edit this image by transforming scale and rotation and save the result. I've got most of it working, the user can take a snapshot of themselves, transform the object using Senocular's Transform Tool and i'm using .draw() to then save this transformed object. The problem is .draw() is only grabbing data from the top left corner of the stage. It is drawing the transformed object but only from the top left corner. Why does it only draw from the top left corner and how can i get set the coordinates to only draw from the area where the captured image is set?

[Code]....

View 2 Replies

Limitations :: Load And Split A Massive Image In Flash??

Jul 25, 2011

How do you load an image that exceeds the 4096×4096 limitations of flash while splitting it?

View 5 Replies

ActionScript 3.0 :: Bitmap.draw Twitter Image Sandbox SecurityError

Nov 30, 2010

So i've got a piece of an app that's grabbing the JSON result from a Twitter search, then calling a Loader to grab profile images for each result to place next to the text of the result.[code]when it's trying to rescale and draw the bitmapdata.I have a LoaderContext checkPolicyFile = true set when it loads the actual user image source, I have allowDomain and loadPolicyFile set for crossdomain.xml at URL... and I basically have looked at and tried everything in all of google and I still keep getting these security errors and not having the images shown properly.

View 2 Replies

Flash - How To Convert Bitmap Data Into Image File In AS3

Apr 30, 2010

I want to convert bitmap data to an image file like jpg or png file in AS3.

View 1 Replies

Flash :: Use The CS4 Tool's On A Bitmap Image After Tracing The Bitmap Image And Applying My Settings?

Aug 7, 2009

Use the flash CS4 tool's on a bitmap image after tracing the bitmap image and applying my settings?

View 10 Replies

ActionScript 3.0 :: BitmapData Draw() Method - Draw The Bitmap On The Stage At Design Time?

Mar 18, 2009

I am using the draw() method of the BitmapData to encode a jpeg of part of the image. Now this should be easy enough given the object I want to draw to the bitmap is on the stage at design time so I know its location and dimetions exactly! Heres the code I have in place.

Code:
var myBitmapSource:BitmapData = new BitmapData ( street.width, street.height, false, 0x333333);
myBitmapSource.draw(street, null, null, null, new Rectangle( 96, 5, 571, 450 ), true );

I know for a FACT that no part of the street clip I am drawing out is in negative space, and it's registration is (0,0). However, it cuts off A lot of the top of my image. y=5 in the above rectangle is where I need the top to be, but it cuts the top off of the image... even if I change it to 0, it has no effect.

View 2 Replies

Actionscript 3 :: Single Massive Class For All Data Storage?

Nov 14, 2011

I have created a class that I've been using as the storage for all listings in my applications. The class allows me to "sign" an object to a listing (which can be created on the fly via the sign() method like so):

manager.sign(myObject, "someList"); This stores the index of the element (using it's unique id) in the newly created or previously created listing "someList" as well as the object in a 2D array. So for example, I might end up with this:

[Code]...

View 1 Replies

ActionScript 3.0 :: Draw Bitmap Instead Of Export Bitmap?

Nov 5, 2009

I'm using Sandy to animate some objects in 3D. What I currently do to images which are EXPORTED in the library, I want to do to some bitmaps that I create using the DRAW technique. But it wont work :-(

CODE FOR 'CREATED BITMAP' :
ActionScript Code:
var bData:BitmapData = new BitmapData(myObject.width,myObject.height);
bData.draw(mask5);

[Code]....

Sandy doesn't seem to treat the 'created' bitmap the same as those that are exported from the library.

View 0 Replies

Flash :: Accurately Draw Rotated Bitmap?

Jan 28, 2010

I have a container with masked bitmap in it. The scale and rotation of this container changes at runtime, and I need to draw the masked bitmap but cannot figure out the appropriate matrix calculations to do so.My code works correctly to reflect position, scale, offset for centering without rotation. When rotated, the angle is correct but the positioning is incorrect - I believe because the dimensions change when the rectangle is rotated.how to compensate for this in the positioning - here is some code:

// Adjust the transformation matrix to account for the position of the container
var tMatrix:Matrix = _imgContainer.transform.matrix;
//Offset for container

[code].....

View 4 Replies

Flash - Draw Dot As Sound Spectrum In Bitmap

Nov 18, 2010

I looking into become a sound programmer. As I could find some sound analyzer would display a nice spectrum of color on bitmap. Which API do I draw a dot shape? Is it circle or line? Is it possible to resize the bitmap width and height after adding all the dots?

View 1 Replies

ActionScript 3.0 :: Manipulate Bitmap Data Of Externally Loaded Image

May 2, 2011

I need to be able to manipulate the bitmap data of an externally loaded image (an image from the internet), however there seem to be security protocols preventing access to this.Is there a way I can gain access to the bitmap data of an image loaded from an external source? What I'm after is being able to save the image to disk, or pass the image to the printer. (I can do both of these things, but I'm not being given proper access to an external image)I've done a few work arounds and the best I've been able to get is it working for a few images, but not all images. Even if the image loads properly and can be displayed in flash, I'm not guaranteed access to the bitmap data.

View 1 Replies

ActionScript 3.0 :: Bitmap Data - Display The Image When Compile The File Into A Swf??

Nov 5, 2010

I imported a image file to my library and exported it for Actionscript. Which it created a new class that extends the bitmapdata class. Do I create an instance of that data and pass it to a sprite and add the sprite to the stage so I can display the image when I compile the file into a swf? Ive tried that and get an error saying that I need two arguments. I guess im just not sure what to do with the bitmapdata class.

View 1 Replies

Flash - Draw A Bitmap In Graphics-Object At Any Position?

Mar 30, 2011

Is it possible to draw a Bitmap to a Graphics-Object like

this.graphics.beginBitmapFill(bitmapData, matrix, false);
this.graphics.drawRect(0, 0, w, h);
this.graphics.endFill();

with an offset?

A simple moveTo(x, y) call before beginBitmapFill does not work :/ Neither does changing the x and y value of drawRect... (That just seems to have the same effect as an translation with the matrix...) Additionally I don't want do draw that thing in a separate Graphics-Object and add that one into the other...

View 2 Replies

ActionScript 3.0 :: Drawing Movie Clip To Bitmap Data - Image Looks Different Depending On Size?

Jul 13, 2010

I've written a class that iterates through all the frames of a movie clip and draws each one to a different bitmap. When I'm done, I should be able to iterate through the bitmaps and play them like a flipbook animation.If I draw all the clips to the same size bitmapdata, then everything looks great. But this is wasteful because now a lot of the bitmapdata's are bigger than they need to be (takes up more memory), and also causes problems because the hit tests don't look right.

So next I try to crop all the bitmapdata to be the smallest possible sizes. However, when I do this, there are subtle differences in the way the images look - the edges might look slightly darker in one frame than in another. When I line up all the images and play them back to back, it no longer looks the same way it originally did.I have no idea why the images look different, and have no idea how to work around this problem, I have tried many different approaches. I have tried using BitmapData.draw(), BitmapData:copyPixels(), and manually using BitmapData:SetPixel(), and all end up with the same result

View 5 Replies

ActionScript 3.0 :: Loading Images From Xml And Taking Out Their Bitmap Data - Image-order Goes Bananas?

Sep 2, 2009

I load data from xml and want a list of thumbnails with text to be lined up. A handful of text-attributes to the xml-rows, including a src-attribute, which links to an image, goes through as wanted - text is shown, and images are shown. The image order, however, varies when I have more than two rows and is completely wrong. The text-attribute-order to each thumbnail remains perfect in all scenarios.The images bitmapData is taken etc., and the images are scaled to a proper thumbnail size. This might be where something goes wrong?

ActionScript Code:
function xmlLoaded(e:Event):void
{

[code]....

View 3 Replies

Actionscript 3.0 :: Draw Lines With Flash's Core Graphic Class But Attach A Custom Bitmap To That Line?

Mar 31, 2009

[URL]

Are they just constantly adding MC's to the display list as the mouse is moved around? Doesn't that kill memory?

Is there a way to draw lines with Flash's core graphic class but attach a custom bitmap to that line?

View 10 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 :: Get Bitmap.draw() To Work?

Apr 16, 2009

I can't seem to get bitmap.draw() to work. I've used it before in exactly the same way but this time Flash decides to put out this error:

"ReferenceError: Error #1069: Property draw not found on flash.display.Bitmap and there is no default value."

With the following code, tile1-5 are movieclips in the library consisting of a few instanced movieclips inside them.

Code:
// Add the tiles from the library into arrays for each area.
private var a1Tile1Bmp = new Bitmap();
private var a1Tile2Bmp = new Bitmap();
private var a1Tile3Bmp = new Bitmap();

[Code]....

View 3 Replies

ActionScript 3.0 :: Draw Bitmap With Exectfit?

May 16, 2011

I have a movieclip with textfield placed on it. My stage size is 1003 X 560 pixels. When i open it in html page with exectfit and 1366 width and draw bitmap of that movieclip. Then text always gotowards right.

View 3 Replies

Actionscript 3 :: Draw() With Transparency On A Bitmap

Nov 7, 2011

I want to apply transparency to a non-transparent logo then add it to an image. So I change the alpha of the logo, then I draw() the logo on the image. But it doesn't work, the transparency isn't applied as expected.

Note: I will later save the resulting bitmapData to a file, so an addChild() won't be enough to solve this.

var image:Bitmap;
var logo:Bitmap;
//...
logo.alpha = 0.3;
image.bitmapData.draw(logo);

View 1 Replies

ActionScript 3.0 :: Draw TextField Into Bitmap

Oct 24, 2007

I have a need to draw a TextField into a Bitmap. And I can do it with one minor problem. When the TextField is added to the display list it has no background. When I draw it to the bitmapData object it always has an opaque white background. Is there any way to get the TextField to draw to the bitmapData with a transparent background? Here is the code I currently have that does draw the TextField in the bitmapData, but with an opaque background.

[Code]...

View 9 Replies

Actionscript 3.0 :: Bitmap Draw Only A Section?

Oct 23, 2010

i have video playing on the stage.. there is a sprite called _rect that is moving around the screen when it finds a face in the video.. that part works great.. but what i want to do is capture the face the _rect is currently over, from the video underneath and draw it into a bitmap,, but it keeps just drawing the upper left corner of the video..what i want is if the _rect has an x of 300 and a y of 300 and its dimensions are lets say 200x200hen the bitmap it draws from the video is 200x200 but starting from x:300 and y:300.. but like i said..o matter where the _rect is located it keeps drawing from 0,0.

Code: Select allvar myBitmapData:BitmapData = new BitmapData(rect.width,rect.height,false);
var clipArea:Rectangle = new Rectangle(rect.x,rect.y,rect.width,rect.height);
var myBitmap:Bitmap = new Bitmap(myBitmapData);

[code]......

View 1 Replies

ActionScript 3.0 :: Repeated Bitmap Draw() Bug?

Aug 28, 2009

I wrote the code below to convert timeline-animated movieclips into bitmaps to improve performance.The only problem is, I have created a loop to draw each frame of the movieclip over 300 times. The bug I am experiencing is that when the function BitmapMC is run 314 times, I get the error: "ArgumentError: Error #2015: Invalid BitmapData."It seems as if Flash is running out of memory or something, but I can't figure out what might be causing this problem.

Is there an alternative to draw() that I could use? I'd like to use copypixels, but of course I have to draw the bitmap first before I can do that.Incidentally, the animation I have converting to bitmap has 30 frames, so in total it is drawing about 9,340 bitmap images before it crashes.Each bitmap image is 78 x 125.5 pixels.

The code is below:

Code:
package com.jpardoe.utils
{
import flash.display.MovieClip;
import flash.display.Bitmap;
import flash.display.BitmapData;

[code]....

View 5 Replies

ActionScript 3.0 :: MV Container And Draw Bitmap

Sep 3, 2009

I have a MV called container. It has no specified size. I add to this container a child, a loaded SWF. And then, later, I draw this container into a BitMapData.

Code:
var jpgSource:BitmapData = new BitmapData (container.width, container.height);
jpgSource.draw(container);

On most of my loaded SWF, bitmap is the correct size of the original loaded swf. But sometimes, the bitmap is smaller and I miss part of my draw..

Does a my container take the size of his child ?

View 1 Replies

ActionScript 3.0 :: Split A Bitmap With Draw?

Oct 11, 2009

is there a way to split a bitmap with draw, clone or whatever in two peices looking like in first picture?

also, it doesnt neccessarily have to be from corner to corner (like in second picture)

View 2 Replies







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