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


Similar Posts:


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

Export Vector Animation As Bitmap?

Jun 18, 2010

We have some very complex animations that, for performance reasons, we want to have them be bitmaps at runtime..

For example, maybe i can write a jsfl script to copy each frame and paste it into a new .fla as a png instead of as vector art, but I haven't explored that option much.

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

ActionScript 3.0 :: Bitmap.draw And RTMP?

Nov 23, 2009

I am trying to use Bitmap.draw on a streaming FLV. My streaming host is limelight and they said they have this already added to their application.xml

Code:
<AudioSampleAccess enabled="true">/</AudioSampleAccess>
<VideoSampleAccess enabled="true">/</VideoSampleAccess>

The error I am receiving is this:

Code:
SecurityError: Error #2135: Security sandbox violation: BitmapData.draw: file:///D|/POST/VTOD/09.%20Interactions/Untitled%2D1.swf cannot access rtmp://myserver.net/blah/blah. RTMP content cannot be accessed using this API.[code]....

View 3 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 :: 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 Draw Once Fully Loaded?

Oct 1, 2009

Im trying to draw a bitmap of an dynamically loaded image via xml, and ofcourse i'd like to apply smoothing to my images, as my page resizes with the browser and creates a mess.

The images are loaded with a timer event, which fires every 200ms, and each time this occurs, I'd like to quickly draw the bitmapdata of the image so i can apply the smoothing.

My problem that im having is that the images aren't completely loaded when I run the draw method and so im left with a white box instead.

Currently im using:

Code:
function itemHandler(event:Event):void
{
loadThumbs(event);
thumbLoader.unload();

[Code].....

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

Flex - Function To Redraw Bitmap On Sprite Without Passing In Said Bitmap?

Feb 22, 2011

If I have a BitmapData that's already been drawn onto a Sprite. Is there a way to redraw the BitmapData onto a Sprites Graphics object without having to invoke beginBitmapFill and passing in the same BitmapData?

View 1 Replies

ActionScript 3.0 :: Drawing From Bitmap To Bitmap Overrides Earlier Graphics?

Dec 29, 2010

I'm working on a game, and to keep performance good, instead of addChild'ing 50 new sprites to the stage every second, I decided to have each player draw to their own bitmap, and then to the 'master' bitmap. This introduces an issue though: the second player would override all data the first player has put into to bitmap...My basic debugging proof of concept:

Code:
// bitmap test

import flash.display.Bitmap;
import flash.display.Bitmap;[code]......

View 1 Replies

ActionScript 3.0 :: Draw Nested Animated Movielcips To A Bitmap?

Apr 14, 2010

I'm new to flash and don't know if it's even possible. I'm trying to cache animations using mc.gotoAndStop(frame) and bitmapData.draw(mc,matrix). This works perfectly for movieclips that doesn't contain any nested movielclip animations. When I have nested movieclips, only the 1'st frame of nested clip gets drawn. Is it possible draw moviclips with nested animations?

View 3 Replies

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

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

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

ActionScript 3.0 :: Copying A Rotated Bitmap Into A Bigger Bitmap?

May 9, 2011

I have a bitmap which has several frames (packed along the horizontal axis). In order to render them I copy it to the backbuffer (larger bitmap) as follows:

Actionscript Code:
public override function copyToBackBuffer(db:BitmapData):void{ if (active)  var drawRect:Rectangle = new Rectangle((currentFrame-1) * frameWidth, 0, frameWidth,

[code].....

View 5 Replies

Actionscript 3 :: Update A Portion Of A Bitmap With A Pixelbender Instead Of The Whole Bitmap?

Feb 17, 2012

In pure AS3, I have a pixelbender and a large bitmap. The pixelbender is configurable with a distance parameter to affect only a small area of the bitmap. The problem is that the pixelbender is executing over the whole bitmap. What would be the best way to update only the effected region of the bitmap? Given this config:

[Code]...

View 1 Replies

ActionScript 2.0 :: Bitmap Font Text Drawn To Bitmap

Oct 8, 2006

Is there a way to write a bitmap font right into the bitmap being desplayed? Mabey better worded: myBitmap.draw(image, t) draws a picture is there a way to draw text? I'm stuck even if its just a work around in some way I would like to know... (the current work around i have in my head is writing it in a movieclip turning that into bitmap data and drawing it... esentially creating a prototype answering my question... but a built in way would be easier probably).

View 2 Replies







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