Actionscript :: Flex - Snapshot With Clipping Rectangle And Scaling Matrix?
Jan 29, 2010
var snapshot:ImageSnapshot = ImageSnapshot.captureImage(someSprite);
var file:FileReference = new FileReference();
file.save(snapshot.data,'abc.png');
n the above code I am able to capture an image.But I also want to apply a scalingMatrix(for zoomIn/Out) and a clipping rectangle to it. How to do it? I tried capturebitmapdata too, but with that I can't even get a proper image. See here. So I don't want to use that.
View 1 Replies
Similar Posts:
Apr 1, 2012
I'm trying to scale text from 1 to 5, a sort of zoom in type of look. I'm using the code below:
<s:Scale target="myLabel" autoCenterTransform="true"
duration="2000"
scaleYFrom="1" scaleYTo="5" scaleXFrom="1" scaleXTo="5"
>
The text scales terribly. So my goal is to take a snapshot of the text label at a large font, add it to the display list, set the scale to a 5th and then animate the scale up to 1. After that I have to set the text again and do it all over again.
This is a Flex app and that's where my question comes in. I don't know how to take a snapshot, then what to add it to (group?) and then how to erase it and start over again?
View 1 Replies
Mar 4, 2010
I have the starting point of a rectangle, and the rotation of the line that I would like this rectangle to be parallel to. My initial thought was to create a Rectangle() then rotate it, but there doesn't seem to be an easy method rotate a rectangle. From this rectangle I create I can obviously get the four points, but I need these to be adjusted based on an angle of rotation that I pass it.
View 1 Replies
Sep 10, 2009
We have discovered that when we draw one bitmapdata into another bitmapdata using draw, there is an upper bound on the scaling transformAt some point the IBitmapDrawable parameter ceases to be rendered on the target bitmap.Does anyone know what the parameters of this upper bound are? Is this documented somewhere?
View 4 Replies
Mar 25, 2012
I want to scale my round rectangle and keep it's radius from been changed. How can I do that?
I am exporting SWF to flex and drawing it there. Do not scaling it in run time, just need few sets of scales.
View 1 Replies
Nov 8, 2009
I want to take a snapshot of a movieclip and add the snapshot to the stage on every frame.
Does anyone know how to do this?
I'm trying to achieve a reflection effect...
View 3 Replies
Jul 7, 2010
How is cropping/clipping accomplished on a Sprite in Flex?
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="Init()">
<mx:Script>
<![CDATA[
[code]....
Notice that the lineTo completely leaves the UIComponent and Panel.How can I cause my UIComponent or Sprite, Or Panel for that matter, to be cropped/clipped? I realize I could just change the hard-coded 2222's to something more reasonable, but I need a generalized solution to this, since the actual project doesn't involve hard-coded values that I can alter, but works with dynamic data.
View 2 Replies
Aug 24, 2011
I have a container with a vertical layout inside which I have two other child containers "A" and "B". n the first container "A" there is a component that I would like to resize dynamically based on the available display size. To to that I tried listening to the resize event of the main container and do my measures accordingly. That works somewhat until the parent container reaches a clipping size : container "B" gets clipped earlier than "A" because it contains much more stuffs : As soon as the parent container reaches "B"'s clipping size, it does not resize anymore (so no more resize event either) thus preventing me from updating my component's display in "A".
View 1 Replies
Apr 5, 2003
Has anyone here ever developed a function (or general library of relevant functions) that will allow one to find the inverse of a matrix? I've searched the forum archives, as well as the internet more generally, but haven't found anything. If anyone has some leads, I hope you'll pass them along.
If I don't hear anything within the next few days, I might try to develop something on my own, but I'd hate to do so if someone has already done the dirty work.
A solution to this problem would be very useful for 3-D work or anyone doing mathematical programming more generally.
View 14 Replies
Jul 9, 2009
i'm creating a visual editor in flex and need to let users export thier projects into Image format. But i have one problem: size of the canvas is fixed and when user add element which is out of these sizes some scroll bars added. And user continue working on the project. but when he want to take snapshot of the canvas he just get the visible part ot the canvas with scrollbars. how to get image of the fullsize canvas?
The only solution i found is to check the positions and sizes of canvas child objects and rezise it to fit them. then take snap and resize back. But it hmmmm... too complicated i think. Is there some "easy methods"?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
[Code].....
View 3 Replies
Mar 15, 2010
var is:ImageSnapshot = myImagesnapshot;
var str:String = ImageSnapshot.encodeImageAsBase64(is);
As of now, I am sending my jpeg data to the server with the code above. The problem is that it almost doubles the size of the data. Is there a way to send the image data directly without using any encoding.
View 3 Replies
Jul 11, 2010
Using Flex, what is the recommended way of taking a webcam snapshot picture? Something along the lines of:
var camera:Camera = Camera.getCamera();
var image:Image = /* magic goes here */
View 2 Replies
Nov 6, 2009
In my application a canvas object has height = 90 px & width = 86400 px (indicating number of seconds in a day [60 * 60 * 24] ). The canvas is scrollable and the user can add or delete components in that.Now, I want to have snapshot of the whole canvas & shrink it to size 910x30 to draw taken snapshot in another canvas.Can anybody tell me how to take snapshot of such large Component?I have tried to take snapshot in BitmapData object but as it max width is 2880 can not give whole canvas snapshot.
View 3 Replies
Sep 13, 2010
I am coding in AS3 and I am using BitmapData to take a snapshot of a movieclip. Is there a way to have the end result BitmapData to support transparency?
How do I take a snapshot of a movieclip without any background?
View 2 Replies
Feb 2, 2011
I had mx:Video object that play live strreamingvideo So how I can take snapshote of that Video
View 1 Replies
Feb 3, 2011
I have a video display in my flex app. which is attached to the camera. The camera resolution can vary depending on the user's selection, While the video display (preview) dimensions are fixed. I am then doing this:
bmd.draw(vidDisplay);
Where bmd is the bitmap.. The problem is the resulting bitmap has the correct size of the camera settings (which is set) but the capture from the video is always the size of the video display inside the bitmap.. I hope i am making sense. The result looks like a little picture inside a bigger image top left justified. I want to have a video display preview with fixed height, but be able to take snapshot with varying resolution.
View 2 Replies
Mar 31, 2011
I was wondering how you can use the matrix to increase the component of the canvas!
View 1 Replies
Nov 12, 2009
I'm at a very basic level with Flex and with programming in general. I am working on a project where I have data in an Excel (.csv) format, it's a large Excel plot/matrix where each cell has a temperature number. I want to import this matrix into Flex somehow, or parse the data in Flex, so that this matrix turns into an interactive heat with colors corresponding to varying temperatures from blue (cold) to red (hot), and each spot on roll over shows the temperature number.
Should I use plot charts, or some other control? should I convert data into XML or import into a MySQL database, would that be easier for Flex? But then, again, the data is basically just a large matrix, there's no headers/ fields in a traditional database sense, just many cells each having a temperature number. how I can import the data into Flex and use it as data provider to plot the heat map?
[Code]...
View 1 Replies
Jan 24, 2010
How can I rotate an Image eg. 180 degrees clockwise using the Matrix. I can use the following code to rotate the image 90 degrees, but it is incremental, meaing
var matrix:Matrix = new Matrix();
matrix.rotate(Math.PI/2);
matrix.tx = imgControl.content.height;
var bitmapData:BitmapData = new BitmapData(imgControl.content.height, imgControl.content.width);
bitmapData.draw(imgControl.content, matrix);
imgControl.source = new Bitmap( bitmapData);
[Code]...
View 1 Replies
Oct 18, 2010
I have a UI component that I wish to relocate and scale, but in a rather complex way. I've figured out the necessary transformations using the transform matrix, to which I applied several translate and scale operations. I can set the new transform matrix for this UI component to be the above calculated matrix, and the results are accurate; but I need to animate the transition. I can't use the Scale/Move effects alone because they aren't as powerful when it comes to calculating the necessary transformation as the matrices are.So how can I animate the transition of an object given a source and a target transform matrix?Figured it outUsing a tweener and its onUpdate event to reassign the matrix with each intermediate value:
var animMatrix : Matrix = gi.transform.matrix;
TweenMax.to(animMatrix, 1, {
a : m.a,
[code]......
View 1 Replies
Jul 8, 2011
someone could tell me how I can zoom a Canvas, with transform.matrix, so that the content of the component fits into the parent container (application), either inward or outward
this function is called Zoomfit(), I have this code:
[Code]...
View 1 Replies
Jul 18, 2011
I want to use Image Reflection in trapezoid shape. That why i ask how to create trapezoid shape with the class of matrix
View 1 Replies
Mar 8, 2010
For those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class do the various steps of getting it and loading it for you.So I needed to get a Scrollbar, which I got hereThe thing is, it works with Sprites.After trying to get it to accept TextFieldExtended, I bumped into a block, since the scrollbar relied heavily on a Sprite property that TextFieldExtended didn't have or could have.
So I tried adding the TextFieldExtended instance to a Sprite instance using addchild.A problem occurs here that I do not know how to handle. It seems that a Rectangle is drawn and the Text is drawn on that. I say this because the scrollbar moves the Rectangle up and down a bit, but the text doesn't scroll, just the Rectangle it is positioned in and the text then moves along with it.My question: can this be fixed, or is does this implementation of scrollbars need a lot of adaptations before this is possible?
View 1 Replies
Apr 14, 2011
I'm having trouble with Matrix Transforms in Flex.
I have a Flex Canvas with nothing but an Image in it, like so.
<mx:Canvas>
<mx:Image id="img" source="/some/Url" />
</mx:Canvas>
[Code].....
View 5 Replies
May 20, 2009
I draw a rectangle i should see a little bold circle to indicate a perfect rectangle, I seemed to lost mine, can somebody please tell me how to get it back!
View 2 Replies
Jun 30, 2009
I noticed that for some reason whenever I use the 3d rotation tool on an object inside of a clipping mask that the object releases the clipping mask. Are 3d objects not supported within clipping masks? Is there a way around that?
View 6 Replies
Sep 8, 2009
The last 2 characters or so are partially obstructed by parentheses.
For example, when I type: "stop()" it looks like "sto()".
View 1 Replies
Jan 21, 2010
I have a simple flash video player that streams the video from a streaming media server. The stream plays fine and I have no problems with playing the video and doing simple functions. However, my problem is that on a mouse over of the video, I have the controls come up and when I do a seek or scrub on the video, I get little weird boxes that show over the video - like little pockets - of the video playing super fast (you can basically see it seeking) until it gets to the point it needs to be at and then these little boxes disappear.
View 2 Replies
Feb 12, 2011
I am trying to figure out bitmapdata and was attempting to draw 2 ellipses as sprites,capture the bitmapdata and then spit them out with draw(). The problem is, there is some nasty clipping and I don't know how to get rid of it. I have tried using rect and messing with the draw parameters but nothing seems to work.
Code:
public class fhParticle extends MovieClip
{
[code]....
View 1 Replies
Aug 2, 2011
I am trying to convert a rectangle(actually multiple rectangles) to a curved rectangle. I think it should be pretty easy but I guess i am stupid. Basically I would have a start position and stop position (many of these), and they would be converted to curved rectangles and follow in a cicrle around.
View 0 Replies