Actionscript 3 :: Flash: BitmapData.draw(Video) Ignores Video Height
Mar 4, 2010
I'm pretty much the rookiest rookie when it comes to Flash.
Here's the actionscript (3):
// Here's the dumb-dumb:
/*****************************************************************/
/*****************************************************************/
function captureImage(e:MouseEvent):void {
[Code].....
So I'd still like to find a solution that maximizes the quality.
View 3 Replies
Similar Posts:
Jan 29, 2010
I wrote a collision detection class that works off using BitmapData.hitTest. Basically, every update, the .draw method is called and then two BitmapData's are hitTest'ed against each other to see if there is a collision.It works pretty well, however if I start rotating the source MovieClip I use for the BitmapData, the transformations don't get registered in the draw method. So what I did was pass through a Matrix in the draw method. That works. But here's the actual issue. If I output the BitmapData to a Bitmap on the stage, I see that Bitmap is, in fact, rotating, but now it's exceeding the bounds (width and height) of the BitmapData. Which is cropping / clipping the image of the source MovieClip.
UPDATE: Basically, when the Bitmap clone of the MovieClip rotates outside the positive co-ordinate space, it doesn't get drawn. It rotates outside the bounds of the BitmapData set width and height. I can multiply the bounds by 2, and then center the bitmap inside the set bounds, but then the origin point is never fixed and the object is always being moved around. Works pretty well, but makes aligning the object to any specific point impossible.Here's my isolated test code. It requires you to have a MovieClip on the stage named "iTest". I used a fairly vertical arrow shape (higher than it is wide) so I could keep track of rotations visually accentuate the clipping problem:
var rotateTimer:Timer = new Timer(10);
function rotateObject_init():void
{
[code].....
View 2 Replies
Jan 9, 2012
I am having an issue with using BitmapData.draw(stage). I am getting the following error:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access. Here is a portion of my code:
var bd:BitmapData = new BitmapData(2800, 2100); bd.draw(stage);//this is where the error happens All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1. Let me know if I need to supply any more info.
View 4 Replies
Aug 9, 2011
I have a problem with an flash object. The object is an expanding topbanner, but when retracted, the on mouse over effect still appears on the invisible part of the banner. The code is the following:
<div id="exp_banner" style="width:930px; height:180px; overflow: hidden; position: absolute; z-index: 100;">
<object type="application/x-shockwave-flash" data="test.swf" width="930"
[Code].....
I have tried to add a style height to the object with an height of 180px, but then the banner scales down.
View 1 Replies
Feb 26, 2012
[URL]how do i stretch the movie to fill the entire white area which is set to be 500 to 350 px (please see pic)
the code:
<object type="application/x-shockwave-flash" data="videos/player.swf" width="500" height="350">
<param name="movie" value="videos/player.swf">
<param name="quality" value="Best">
<param name="allowFullScreen" value="true">
[code].....
View 2 Replies
Mar 25, 2011
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
View 3 Replies
Aug 18, 2011
Recently i have visited so many video enriched flash site like this one [URL] Most of them shows video in full size. I downloaded the video using FF plugin. Video framesize is very small compared to the stage size. When i tried to add video and resize the video acoording to the page size , it slows the browser. I tried to embed the flv inside an swf and loaded the swf using normal loader and plyed it.. but the quallity and performance comapred to these site is very low..
View 3 Replies
Aug 20, 2007
How to draw something over a video in Flash? We can use any version of AS and any other programming language.
View 2 Replies
Dec 18, 2010
I made a video in After Effect and export it to flash as a FLV video.. and write de code to load it into flash.. but I need it to loop.. Here is the code
[Code]...
View 1 Replies
Jan 27, 2012
I am attempting to capture a 1920x1080 webcam capture and create a new bitmap with the capture. I feel like I have all the dimension settings correct but the final 1920x1080 bitmap only contains a small 320x240 version of the video capture. Help!
import flash.display.Bitmap;
import flash.display.BitmapData;
var bandwidth:int = 1000; // Maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. var quality:int = 100; // This value is 0-100 with 1 being the lowest quality.
[Code]...
View 1 Replies
Aug 20, 2010
I am using net stream video player with xml. How can i get videos dimension (Width and Height).if suppose i get the dimension of the video and i will change the video size with aspect ratio.
View 1 Replies
Sep 8, 2009
is there any sample on using array bitmapdata to record video from webcam and generate flash movieclip file? i want to record sound as well without using red5/flash streaming server
View 3 Replies
Jan 10, 2011
The plan is to have that video stretch across the whole page (the flash does, the video itself does not).Firstly: well aware of the issues - bad performance, horribly stretched/pixelated video. I know this. However a client wants it so we have to do it, simple as that.Does anyone have any ideas on how this can be achieved? I've been in touch with the creators of the flash video player I'm currently using and they've confirmed it isn't possible with that flash video player.
View 1 Replies
Aug 13, 2009
Is their a way to determine the height and width of your flv f4v file after you dynamically load it?
Couldn't find any properties in the loader or netstreaminfo that I could grab the info from.
View 3 Replies
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
Jan 10, 2010
So due to my lack of time to research this and my strong curiosity for the matter:Does anyone know of any publicly available classes or ways to convert an array of BitmapData to a video format ByteArray (going to save it since I'm using it in an AIR project)?
I was considering writing my own class for it but started in the research and decided it's a very highly developed field and is hard to quickly find the basics of how to handle it. Thus it's usefulness outweighed it's opportunity cost for the time I have unless there is an already made class for handling this.
Mainly was considering this for short clips that one would create for logos etc so that one can display the logo in other environments with ease.
View 2 Replies
Aug 20, 2009
What I've got is a NetStream object that plays video, and I want to be able to get a snapshot of the current data. Unfortunately, I have no idea how to obtain a BitmapData from a NetStream - it seems designed to be attached to a Video object, which through internal actions of the two classes ends up drawing the contents of the stream to the object. Using that - I initially did what seems dodgy to get an image - create a BitmapData object, and draw the contents of the Video object. This works, but it has a significant limitation: The data you get is tied to the Video object, and not the underlying source. So if your Video window is 320 * 240 for example, that will be the size of your bitmap data.
After some research, I thought of approaching it by making the Video object the same size as the underlying NetStream source - using the Video.videoHeight and videoWidth properties. If you know the size of the underlying data before you create the Video object, things are fine. You can just construct the new object with new Video(width, height). The frustrating thing is that the docs say you can change the width and height of a Video object after construction using the Video.width and Video.height properties, but it's not the same thing, since you also end up changing the scale.
how to either adjust the width or height of a display object without adjusting the scale(there was mention of a registration point in some of the docs I read), or failing that, a less roundabout way of taking a snapshot of data in a playing / paused Netstream?
View 1 Replies
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
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
Mar 5, 2010
When I publish my FLV video using Flash CS3 and the "SkinUnderAll" option...the player controls are not visible unless I change the height & width in the html file Flash created.But, Flash shows the height & width 3-times in the html.
Question-1: Why 3-times? What does each of the 3 Height & Width references do?
Question-2: How should I modify the code to be able to see the entire video and the player controls?
It seems if I change all 3 everything just gets bigger and bigger.
1 - I import it into Flash CS3 on a PC w/XP Pro using... File | Import | Video take all the defaults and choose "Skin Under All" as the player option.
2 - In "Properties" panel at bottom of screen Flash shows the video as 640x480
3 - I then click File | Publish to publish the video. Flash creates all my files for me.
MyVideo.fla
MyVideo.flv
MyVideo.html
MyVideo.swf
SkinUnderAll.swf
AC_RunActiveContent.js
4 - I then put the folder with the files on my website.
5 - The video plays but the player controls are not visible.
6 - I see the Height & Width referenced 3 times in the html file Flash created for me (and none are 640x480, they are 550x400 !)
7 - I try changing the 550x400 to 640x480 in all three places... no good. Even at 1000x1000 the entire player is not visible. Everything just gets larger.
What are each of the 3 references to Height and Width in the html file Flash Creates and which should I change to simply show all the player controls?
View 2 Replies
Jun 30, 2011
I'm making something that requires me to draw() the youtubeplayer Giving me this pretty error:
[Code]...
View 4 Replies
Dec 15, 2009
I'm trying to do some lean blitting for an object that rotates by rotating it once at startup and capturing a BitmapData snapshot of each 5 degrees. The problem I'm having is that the draw() method of the BitmapData object is only picking up pixels in the MovieClip that are below and to the right of the registration point. If I change the MC so that the registration point is in the top left corner, I sometimes get what looks like most of the pixels, but the entire object rotates into and out of the frame, since it's rotating around the corner and not the center.
View 5 Replies
Oct 13, 2011
Im trying to make a video class so I can put in my src and video dimensions to load up a video .. I am wishing to implement this in the following way
[Code]...
View 2 Replies
Jul 31, 2010
I need to draw last frame of my video into a bitmapdata. how do i do that?
View 0 Replies
Mar 31, 2011
I'm getting this one: Error #2123: Security sandbox violation: BitmapData.draw
while I try to draw the image of a video from a rtmp server onto a BitmapData object. The workarounds I've found all apply to a SWF file being loaded from another domain. This involves having logic in that file.However, I see no possibility to place logic into the video and hardly have access to the (WOWZA) video server of which there are multiple and to me unknown ones at forehand due to the CDN's load balancing nature.
View 3 Replies
Oct 2, 2009
I have problem when drawing transparent png image on transparent bitmapData.
code of first frame:
stop();import flash.display.Bitmap;import flash.display.BitmapData;import flash.display.BlendMode;import flash.geom.ColorTransform;import flash.geom.Matrix;
var bmd: BitmapData = new BitmapData(500, 400, true, 0);var bitmap: Bitmap = new flash.display.Bitmap(bmd);addChildAt(bitmap, 1);
[Code]...
View 1 Replies
Apr 16, 2007
I try to make a simple copy of a flv video in a new MovieClip using the BitmapData class.
Here is my code :
Code:
var video1:MovieClip = this.attachMovie("mcVideo","videoMC",1);
var objVideo = video1.v;
var _nc:NetConnection = new NetConnection();
[Code]......
View 6 Replies
Aug 20, 2010
I am new in AS3.I am using net stream video player with xml. How can i get videos dimension (Width and Height).if suppose i get the dimension of the video and i will change the video size with aspect ratio.
View 7 Replies
Aug 20, 2010
I am new in AS3. I am using net stream video player with xml. How can i get videos dimension (Width and Height).
if suppose i get the dimension of the video and i will change the video size with aspect ratio.
View 1 Replies
Apr 9, 2011
I am using NetStream.appendBytes() to play a local video (no server involved) in Adobe AIR. I would like to use BitmapData.draw() to take a picture of the video output, but I am getting this error:
Error #2123: Security sandbox violation: BitmapData.draw: cannot access null. No policy files granted access.
Here is some sample code:
package
{
import flash.display.Sprite;
import flash.filesystem.File;
[Code].....
This is only sample code use for an explanation. The error would happen when calling the getImage method while the video is playing. The error mentions a policy file not found. Since the file is loaded locally there isn't really a place to put a policy file. Is there a policy setting somewhere that needs to be set or is the BitmapData.draw feature just not available when using appendBytes?
View 5 Replies