ActionScript 3.0 :: Get Scale Value From Rotated Image?
Aug 21, 2009
I have made an application where you can design your own greeting cards. I use matrices to scale and rotate images, and I always need to know what scale the image has.
It works when the image isn't rotated, by taking the value from matrix.a or .d which are the scaleX and scaleY values. But when I rotate the image, using the matrix.rotate() function, the a and d values no longer corresponds to the scale of the image.
How can I get/calculate the scale value of an object that is rotated? And I don't want to scale the image by using the scaleX and scaleY methods.
This is unfortunately a quite complex issue to explain, so please don't get discouraged by the wall of text - it's there for a reason. i'm working on a transformation manager for flash, written with Actionscript 3. Users can place objects on the screen, for example a rectangle.
This rectangle can then be selected and transformed: move, scale or rotate. Because flash by default rotates around the top left point of the object, and I want it to rotate around the center, I created a wrapper setup for each display object (eg. a rectangle).
[Code]...
Now, to the question: should I use a different kind of setup, system or structure? Should I maybe use matrixes, if so, how would you keep a static width/height after rotation? Or how do I fix my current wrapper system for scaling after rotation?
I need to rotate the imageClip,then zoom in,then i need to scroll the imageClip fully.ve the tutorial for thisboth horizontal and vertical scroll for Rotated imageClip..
I have a couple of images, representing tents, that look like this: The red and blue parts on each side of the tents are doorways, and several tents can be connected together via these doorways. For example, I want to connect the two blue doorways so that they match up like in this picture: If the first tent is stationary, around which point do I rotate the second tent and how do I calculate where to place it?
Currently, I have the upper left corner of each doorway as an x and a y value, together with the width and direction (in degrees) of the door. I'm treating the doorways as one dimensional, so they don't have heights. Would another representation suit this better? Perhaps a start point and an end point plus direction?
I'm loading external images in a flash animation, on slides, and these ones get a random rotation.My problem, the rotated images are looking bad and pixelised almost like if you were using bitmap text for dynamic text areas.
I would like to make a very simple (well, looks simple anyway) image gallery, like Ilyas da Pom's at [URL]..
I want the image part to scale to fit each image dynamically. I'm a brand-spanking new Flash novice, and any guidance would help really; this is just a tiny little personal project, not to be used anywhere commercially.
I have a image of burlap @ 500 width x 430 height. I need to tile this as my entire background for my full screen flash site. flip the image horizontally for every other placement horizontally, and then i need it to flip vertically for every other Vertical placement. So the image only looks seamless if i do this. I have a illustration below to help show what i mean.
What would be the best and fastest way to scale/resize an image which is injected into PHP file which is called via AJAX with use of jQuery?
So I am trying to assure the image does not bypass the width of 600px and height of 410px but I do not wish for the image to be maxing out this dimensions and look weird, it has to be displayed as it would be, but just in smaller scale.
Also if there is a way I can do this with a already existing Flash script that would be great, but I do not recall of any good ones which are as simple as one used by Google on there Picasaweb service.
I have built a very simple Flash gallery in CS4 using AS2. It calls the images from an XML file and works great. The problem is that the captions underneath the images are in a fixed width text box. They look fine underneath horizontal images, but I want to have the text shift in when a vertical image is loaded, and is narrower.
Why is it that when you animate a photograph (especially animating scaleX or scaleY), it looks so crappy? I've tried caching as a bitmap, turning off compression, etc, but not What's the story here?
I am wondering how would I scale an image on browser resize with minimum and maximum width and height parameters?
I know how to use the Event.RESIZE function to make my image proportional with the browser using stage.stageWidth/Height, but I am trying to figure out a way to have a movieclip or image scale up or down to a certain dimension such as on browser resize the image max would be 640x480 and the minimum being 320x240.
I'm trying to make a zoom in and out effect, on images in a movieclip, using the mouse wheel. But, there is another mouse event that scrolls through the frames of the movie clip. I need it to stay zoomed in, and out respectively, when you scroll to the next frame.
I have a list of artist, each one a mc, in a vertical display. Next to them, I have a holder in which I load the thumbnails one the mouse is over a mc.This images, are being loaded via loadclip.. resize-center and then shown with alpha..But sometimes, the image are shown huge, and instantly resized and positioned.This a dvd project.. so images are not being downloaded..this is the part of the code..
Ok so for a while now I had this tiny chunk of code that would resize and image and scale it proportionatly. However I just realized there is an issue and I'm having some trouble fixing it - which should be a joke to fix but I can't.
I am trying to achieve an effect seen as on this website. [URL]
I want to have a background image that resizes to the browser window (my other elements retaining their size) - but stays in scale. I have been using the code provided at gotoandlearn which tiles the image. Here is the code used there.
import flash.display.BitmapData; GreyBar._xscale = Stage.width; var tile:BitmapData = BitmapData.loadBitmap("tile");
When I created a Bitmap object from drawling the pixels of an image and then scale that Bitmap too large (or even too small) the image disappears or in some cases distorts in what appears to be random pixels barfed all over my screen.
In order to show you this I have made an example: [URL] (click the plus button any more than 8 times and poof! the bitmap disappears) And source: [URL] (Flash CS4)
http:[url]....In my opinion, the way in which the photographs on this website scale, is perfect.I know how to load an image, dynamically, and add it as a child and in fact scale it.What I don't know, is how to scale it in the way the designer has in the example above. The code I use to scale the Child (the image) at the moment is this:
//IMAGE WIDTH OVER HEIGHT var ratio:Number = (1052/700); //SET HEIGHT OF CHILD[code]......
The designer appears to have used minHeight and minWidth commands to ensure the image doesn't scale beyond certain height and widths.
I am still struggling with transforming my app build in Java/Eclipse to Flex/Actionscript with Flashbuilder.Now I can not find how I should implement an image to cover the hole screen.[code]...
How to scale pictures when doing website in FLASH. I am creating a flash based website for a friend. I have done all the links and it works great. The only thing is that the images increase as the web browser is maximised. I would like it to decrease as the web browser is decreased, but to increase to a certain size 900 x 651, and stay that size no matter how big the browser is increased by. This is what I am trying to create: [URL]
I have a 3D image gallery I am working on and would like it to fade and scale onto the stage (whilst still spinning)Make image gallery fade and scale in?Here is the link to my test page.
I have also attached the current actionscript code in a zip file.[url]...
This script loads the images dynamically using xml so getting the size of the image to use as a start provides to be a problem, since there is no image to begin with.I found script to be able to scale an image with the stage here:But this only works on a image that is already in the flash file, not one that is loaded dynamically like I'm doing with xml.
i have loaded a colorful image. when i rollover this image, then the image has to change in grey scale.i think it can be done with filter adjust color, but i want to do this with scripts.
i have loaded a colorful image. when i rollover this image, then the image has to change in grey scale.i think it can be done with filter adjust color, but i want to do this with scripts.
I am developing a flash website that will dynamically fit to the size of the end-users' browser and screen resolution. I have a 2100 X 1400 Background I'd like scaled to 100% of the screen size.
So if the user's resolution is 1680 X 1050, the image would scale to that size.
However, another problem arises - I do not want the image to "stretch" or lose quality, and that it must maintain the same aspect ratio. How can I do this?
I have some code to scale an image's width according to its height after the image is being loaded. It works fine on my development PC if I point to the wrapper html using local file system path. However, after I deploy the web application to JBoss AS 5.1, it stopped working - it always sets the image width to 0, causing it to disappear.
There is an Image control that when I click on it I need to zoom in (using the center/transform point where the mouse is clicked). I have the zoom transition working great, but when I set transformX & tranformY (with autoCenterTransform false) it doesn't zoom into that point.
Here is my code that only zooms in (not to a specific point) <fx:Script> <![CDATA[ protected function imgLogo_clickHandler(event:MouseEvent):void { transformer.play(); } ]]> [Code] .....
I wrote these functions which I use in conjunction to scale down some BitmapData and save it as a PNG. However, the scaledImage.draw(originalImage, scalingMatrix, null, null, null, true); line with smoothing set to true does not have the intended smoothing effect when I save the bitmap data as a PNG using the second function. The resulting image file is not antialiased at all. Is there anything I'm doing wrong here?
public static function scaleImage(originalImage:BitmapData, size:int):BitmapData { // Calculate the scaled size.