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


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

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

ActionScript 3.0 :: Draw A Fieldset/groupbox Container?

Mar 15, 2007

I'm trying to draw a surrounding box around various groups of objects (radio buttons, check boxes etc.). Now I can pop the objects on a canvas (cnv1), which is on another canvas(baseCnv), and change the borderStyle to draw a 1px border(cnv1). I can draw a label on cnv1 over the top of the border. My problem is that labels are intrinsically transparent so the text looks crossed out. THIS IS WHERE IM AT NOW.

The next step would be to put another canvas (cnv2) the same width as the label text underneath said label, and set the background color to baseCnv Colour. My problem would then be that I can't size cnv2 untill I know the length of the text, which I can't find out until the field is added to cnv2 so I could count the number of letters in the string, knowing the fontSize I can work out the letters. So it is doable.

There has to be a better, more eloquent/efficient way to do this? So what do you reckon, HOW SHOULD I DO IT?

View 4 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 :: 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

ActionScript 2.0 :: Make Movie Clip Container Draw A Box Behind The Image?

Jul 28, 2009

I am trying to create a gallery where the thumbnails scroll across the bottom and when you click on the thumb a new large image opens up on top of it from the same image.

What i would like to do is open up the large image but draw a box around this image so it blanks out the background of the site and all you see is that picture.

Its a similar function to the way this site works;

[URL]

View 2 Replies

ActionScript 3.0 :: Bitmap Movie Clip Container Resize

May 5, 2009

I'm using the following code to load a .jpg into a movie clip container the problem is I need the container to be a specific size I tried loader.content.width = 50; and loader.content.height = 50; the height part works but the width doesn't work my image just expands beyond the stage width.How do i set the size of the movie clip container?I don't care if the image gets distorted i have a resize script for the images before they are loaded into flash.[code]

View 1 Replies

ActionScript 3.0 :: Generate Bitmap Thumbnail For Container - Zoom Out?

Jun 9, 2009

I found this quite amazing website [URL] and If you see the website when you zoom out there is no animation neither interaction with the content of each container, I mean, if you see the first one, the home container there is a animated banner, however when you zoom out that banner stops. Also, you if see, every time you zoom in a container it loads its content, if you zoom out and zoom in again it loads again the same content...this is cool because you're not wasting too much memory and you're not creating a huge .swf file.. Are they generating some kind of bitmap thumbnail for each container everytime we zoom out or what?

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

Flex :: Draw A Circle Inside Border Container Using Graphics Object?

Apr 5, 2011

My basic requirement is to draw a circle inside a BorderContainer with the layout set to BasicLayout.I run this method in the CREATION_COMPLETE event of the BorderContainer object.[code]I know I must be missing something VERY basic here. Can I just draw like this OR should I draw in some other event? I know that I can create a Ellipse object and easily add it to the border container but I would like to know how I can do this using the graphics object.

View 3 Replies

ActionScript 3.0 :: Draw Sound Spectrum Inside A Display Container Other Than Stage?

Oct 29, 2009

How can i draw sound spectrum inside a display container other than stage?I tried to display it inside the rectangle movieclip but end up in failure.[code]...

View 2 Replies

ActionScript 3.0 :: Drawing Small Tiles Into One Large Bitmap Container

Jan 29, 2010

I have a project that is drawing ~10,000 small tiles into one large bitmap container - it's a mosaic. In Flash proper and in FireFox it takes about 20 seconds to complete the drawing. Very acceptable. In Chrome it takes about 1:30 and in IE it takes roughly 3:00 - both too slow to be acceptable to the client - who of course reviewed with IE. I have Flash set to run at 45 fps - and the images are populated by a Timer - at 2 ms intervals. Maybe 2 ms is too fast? But in my testing 1ms was slower as was 3ms, so I kept it at 2. And it works fine in FF and Flash...

View 4 Replies

ActionScript 3.0 :: Place Two Or More Instances Of The Same Loaded From A Loader Bitmap In One Container??

Nov 29, 2009

Is it possible to place two or more instances of the same loaded from a loader Bitmap in one container?

View 1 Replies

ActionScript 2.0 :: MovieClipLoader - Loading Bitmap In Holder Image Container

Aug 30, 2007

I'm trying to load a bitmap using this: [URL]. It seems like the preload is working fine. I'm just having trouble loading the bitmap from here. it works without the preloader but I can't figure out what's not making it load when it's done.

Code:
function loadTransBitmap(id){
this.createEmptyMovieClip("holder_img", this.getNextHighestDepth());
var mcl:MovieClipLoader = new MovieClipLoader();
preload = new Object();
mcl.addListener(preload);
[Code] .....

I noticed after the load is complete, I traced the width for targetMC, which is where the image should be preloaded..and it comes up as 0. So it seems like there's nothing in the holder_img container. But it preloads something so I don't know what the problem is.
Also: 'id' from the function is just the image (images/1.jpg)

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







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