Rotate an image about it centre point

Can some one please tell me how to rotate an image about its
centre point in flex 2.0?
I've tried using .rotation and looked at matrix
transformation but I can't find a way to set the roatation to the
centre of the image :(

You can combine <mx:Move> with <mx:Rotate>
effects together.
http://livedocs.adobe.com/flex/201/html/behaviors_068_18.html
ps
I would LOVE to see example of applying matrix transformation
to achieve the similar effect, cannot figure out yet by myself how
to achieve it...

Similar Messages

  • Rotating an object about a specific point!

    Hello Guys!
    Have a new Problem!
    I want to rotate an object about a specific point. But up to now i only can rotate something about the x,y,z axis!
    Is this possible to rotate a scene about the point 1,1,1?
         Transform3D rotation = new Transform3D();
         rotation.setRotation(new AxisAngle4d(-x, -y, 0,((Math.PI / 2) - angle)));
    I don't handle it with Alpha because i needn't an animation!
    Please help me!
    Quh

    Hello,
    to rotate an Object A about the Point P you have to do the following:
    1. Get the Transform T which transforms P to Point (0,0,0)
    2. Apply T on A
    3. Rotate A (around (0,0,0))
    4. Transform A with the inverse of T
    leha23.

  • How can I rotate a shape around a centre point in Illustrator?

    Hi all,
    I'm trying to make a pattern in Illustrator and I need to repeat a shape around a centre point, a bit like placing petals around the stigma of a flower. I can do it in Photoshop by moving the centre point of the bounding box to where I want to rotate the shape around, how can I do it in Illustrator?
    I also want to define this as a shape/pattern and use in Photoshop, how do I go about this?
    Many thanks,
    Foxy

    The centroid of a straight-sided polygon is located at the average of its corner points locations. For a given path (a star, for example) you can:
    1. Select the path.
    2. Copy. PasteInFront.
    3. Object>Path>Average>Both.
    For objects with curved segments, you can approximate the centroid by:
    1. Select the path.
    2. Copy. PasteInFront.
    3. Apply some command that adds a bunch of points along the curves (Object>Path>Add Anchor Points, or ZigZag with zero for Size).
    4. Object>Path>Average>Both.
    If you have alot of paths you need to do that for all at once (as when designing a hanging mobile), I have a simple Javascript for that.
    JET

  • How can i rotate an image by a pivot point?

    Hello,
    i have a problem, the Imaq Rotate VI only rotate an image by its center. My problem is i need to do this by a known pivot point. How can i achieve this?
    Thank you,
    Francesco.
    Solved!
    Go to Solution.

    can this post help?
    http://forums.ni.com/t5/LabVIEW/Rotate-an-Image-by-specified-pixel/td-p/2570453
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

  • Rotate an Image by specified pixel

    Imaq Rotate.vi is to rotate an image around its center point (correct?).
    I need to rotate an image by a user-specified point in the image. What I have in mind is to expand the original image so that the specified point becomes the center of the new image, rotate this new image, and trim the image back to its original size. Is this the right way to do it? Or I am making it too complicated?

    All right. First, do you want your "selected point" to have the same absolute coordinates in your new image as in the original? If yes, keep reading. If no, all that follows is irrelevant.
    In the following discussion, you need to bear in mind that I have not used NI Vision stuff, but the Vision functions seem to be very straightforward.  It seems NI has made it easy for you.
    The first thing you have to do is determine the X,Y coordinates of the point you want to rotate around ("selected point"). I'll leave that to you, since you've got to pick a point somehow.
    From the dimensions of the image, the coordinates of your point, and the angle you want to rotate your image through, calculate the X,Y vector that you will "move" your "selected point" along your coordinate system if you do a simple rotation.
    From the Image Manipulation subpalette of the Vision Utilities palette, use the IMAQ Rotate function to rotate your image hawever far you want.
    From the same subpalette, use the IMAQ Shift function to translate the entire image back along the vector you determined 2 steps ago to put the "selected point" back where it was originally.
    If that doesn't do it, it's probably impossible .
    I don't know how to break it down any better than that.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Rotate about a specific point

    I have a script that creates geologic map symbols, positions them, and rotates them into their proper orientation.  However, I do not know how to rotate about a specific point (not the center of the group). The portion of script in question is:
    if (dlg.symbol.bedding.value) {
    var myLine = stGroup.pathItems.add();
    myLine.stroked = true;
    myLine.setEntirePath([[posx,posy],[posx+3,posy]]);
    myLine.strokeWidth = .75;
    var myLine = stGroup.pathItems.add();
    myLine.setEntirePath([[posx,posy - 6.75],[posx,posy + 6.75]]);
    myLine.stroked = true;
    myLine.strokeWidth = .75;
    stGroup.rotate(-azi);
    and I wish to rotate around the point [posx, posy].  How do I accomplish this?

    Thanks!  That worked.  For future reference, here's the modified section of script:
    if (dlg.symbol.bedding.value) {
    var myLine = stGroup.pathItems.add();
    myLine.stroked = true;
    myLine.setEntirePath([[posx,posy],[posx+3,posy]]);
    myLine.strokeWidth = .75;
    var myLine = stGroup.pathItems.add();
    myLine.setEntirePath([[posx,posy - 6.75],[posx,posy + 6.75]]);
    myLine.stroked = true;
    myLine.strokeWidth = .75;
    mapDoc.theOrigin = mapDoc.rulerOrigin;
    mapDoc.rulerOrigin = [posx,posy];
    stGroup.rotate(-azi, undefined,undefined,undefined,undefined,Transformation.DOCUMENTORIGIN);
    mapDoc.rulerOrigin = mapDoc.theOrigin;
    Another parameter in the rotate method to specify a rotation point would be nice.  Still, this works just fine, so no complaints from me.

  • Rotate an image after clicking two times on reference points on the picture

    Hello Community!
    I am looking for a solution to rotate an image by clicking on two reference points on the image. The two coordinate pairs of the mouse clicking can give me the rotation angle with simple geometry. After that I will rotate the image with the calculated angle.
    My problem is: How can I get those two coordinate pairs? I wanted to do it with an easy MatlabScript "input: path ... imread(path) ... imshow ... ginput(2) ... calculation ...output: angle". Apparently imshow doesnt work in Labview
    I already have the Mouse Down event but I dont know how I can make Labview let me click EXACTLY and ONLY two times on my picture and store the coordinates.
    Does anyone of you have a glue/ hint how to do that? 
    Best,
    Annki
    (Started LabView 2 weeks ago)
    Solved!
    Go to Solution.

    Hi Annkitranky,
    welcome to the forum!
    Here is one that works well: http://en.wikipedia.org/wiki/Cyanoacrylate  (Sorry, I couldn't resist...)
    Check this out: http://forums.ni.com/t5/LabVIEW/Using-mouse-click-to-return-image-coordinates/m-p/890731 and http://forums.ni.com/t5/LabVIEW/How-to-find-cursor-position-on-an-image-in-LabVIEW/m-p/1862495 There is a suggestion not marked as a solution, but I think it is: see last posts there; User Event Structure with the position reported implicitly. Further, I would put the Event Structure in the While Loop, where I wait for user input, collect the user inputs and finish (execute rotation on a two-element array).
    If you have a code or something, post it.
    Cheers

  • Lock the centre point of an object?

    I'm using illustrator (CS6) to animate a simple marionette type figure.
    I'm using the Rotation tool to turn body parts around their usual connection points, moving the transform centre point each time.  I'm wondering if it's possible to "lock" the centre point for any individual object to a certain offset from the object's actual centre, so that every time I reselect an object to move it I'm always rotating it around exactly the same place.  I find that if I have to move the centre point from the real centre to where I want to rotate around every time, I'm not getting the exact same spot in relation to the object's bounds, which makes for some weird movements.
    For example, the rectangle that makes up the upper arm should have its rotation point always about ten pixels down from the top and in the horizontal centre of the object.   The elbow right at the top edge, but also in the horizontal centre, of the lower arm.  etc.

    Monika Gause wrote:
    Use symbols.
    They've got a registration point. Position the artwork in relation to that reg point.
    Ahh, that's an excellent suggestion, thanks!   It looks like it should work.. although there's this bit of the documentation that makes me wonder:
    When you create a symbol, you can choose the registration point from any of the 8-point across boundaries or center of the symbol bounding box.
    It sounds like I might not be able to set it to any arbitrary position within the symbol.  I'll give it a shot though.. thanks!

  • Fast rotation of image only for visualization

    Good day, i need some help in a problem i have encountered.
    We are developing an application for automated inspection of electronic boards. The user must insert the board inside a close box containing the camera and the illumination hardware, to help him find the reference we draw a rectangle and overlay it to the main image from the camera. Problem is that the camera is rotated of 90 degree from the natural insertion point of the box and this is no good from the user point of view.
    So i simply decided to rotate of 90 degree the image from the camera, only during the insertion of the board, to help the user. During this fase i have some processing time spent to find the fiducial, over the board, and confirm his position. If i use Imaq Rotate take me about 400 ms to do this operation because i work with large images of 2592x1944. I already tried to reduce the size of the image and then rotate it but i obtained poor results.
    There is some other way, maybe in the Imaq Indicator, to speed up the process?
    Thank you.
    Frabcesco

    I was under the impression that IMAQ Rotate would catch the special cases with 90/180/270 degree rotations.  It might help to try switching a few options on or off.  For example, turn bilinear interpolation off.  I think Maintain Size needs to be turned off also.
    You might be able to use IMAQ Symmetry.  That works really well for flipping images.  I'm not sure if you could get a rotation using a series of flips.  I'm not sure what Center symmetry is, but it might help.  It might just be both a horizontal and vertical flip together, which won't help any.  If you had a square image you might be able to do it.  The more I think about it, the more I doubt Symmetry will do any good.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Rotated Text/Images look fuzzy when Published

    I've a menu on my site which uses angled text. As soon as I publish this however, the text gets fuzzy edges. I thought I could get over this issue by creating the links in my meny as graphics in PS and importing them as buttons but as soon as I roate them in Muse they get fuzzy edges again.
    I havn't made the site live yet as it's in very early design stages.
    Does anyone have an answer to fix this issue? Thanks

    Thanks for coming back to me! I tried that actually as well. I rotated the images which are the links in PS and then imported them and it works fine from a quality point of view but it introduced another issue. My menu is basically composed of links at an angle as I was saying but I save this as a rectangle from PS and import. Only the centre part of this rectangle has text, the rest is transparent. When I align them all up in Muse, some of the links overlap which causes issues with my buttons. If I roll over one, it activates the one beside it. I couldn't see any other way around this other than to create them flat and then rotate them in muse. Do you see how I can fix this?

  • Photoshop and Bridge CS5 does not auto rotate SOME images.

    Photoshop and Bridge CS5 does not rotate SOME of my vertical images.  Most other photos taken in the same time frame and with the same camera display perfectly.
    Orientation is checked for display under Preferences, Metadata, Camera Data. 
    There also seems to be a discrepancy how Orientation is described under Metadata for those images which DO auto rotate : sometimes it is -90 (which is how I hold the camera for verticals and which displays on most verticals) and sometimes it is "normal" even when it has auto rotated the image.   I do not understand this difference.
    "Normal" is also used to describe the orientation of those images which DO NOT auto rotate for viewing.
    The photos in questions were taken using a Nikon D-300 which is programmed to indicate the orientation of the camera and has always been programmed to do so. 
    I know I can manually change the orientation but we are talking about hundreds of images (I have over 10,000 photos in all; most of which display fine).
    What should I be looking for to explain and correct this issue?
    I appreciate anything you can do to help.  Thank you.

    Thanks for responding to my query.  I'll check out the thumbnail size.
    It is just so curious that 90% of the verticals auto rotate and the rest do not.  The ones that do not rotate are even from different years (other images in those years work fine), although all taken with the same camera.

  • How do I rotate the image?

    I am using Adobe Photoshop CC and I need to know how to rotate an image.

    This is probably more than you ever wanted to know about rotating an image. It is an Information Sheet I wrote and distributed to my students and you may find it helpful.
    Three popular methods used to straighten a tilted scene, such as the one shown the first photograph above, are Image Rotation, Straighten and the Level feature in the Crop tool. Each requires you to draw a horizon line or similar reference as a first step in the process, and each produces slightly different result.
    Image Rotation*:
      1. Choose the Ruler tool. (It is nested with the Eyedropper tool.) Click and drag a reference line as shown in the middle image in the top row above.  (The area around the image was lightened and red circles were added for clarity.) Depending upon the subject, the line may be horizontal, as seen here, or vertical.
      2.  Choose Image > Image Rotation > Arbitrary. When the Rotate Canvas menu appears, click OK. The result will be similar to Fig.1 above, showing the entire image.
    Straighten*:
    Once again, begin by choosing the Ruler tool and drawing the reference line. A feature was added to the Ruler tool in version CS5 and it appears in the Options bar: the Straighten command. Click on it and the image will be rotated and cropped as seen at the top/right. If you prefer to have the image rotated but not cropped you may either:
      1. Hold down the Option key as you click on the Straighten command.
      or
      2. After clicking on the Straighten command, choose Edit > Undo Crop.
    In either case the result will be similar to Fig. 1 above.
    The Straighten command, which also appears in CS6, produces a similar image rotation and trims a small amount of picture area as seen in Fig. 2.
    The Crop Tool’s Level symbol:
    This latest innovation, introduced in CS6, uses a command found in the Options bar of the Crop tool. The equivalent of the Ruler tool is built into the carpenter’s level symbol to the left of the word Straighten in the Options bar. Click on the level and draw the reference line. The image will rotate and the largest rectangular dimensions will be framed by the Crop tool plus, in a shaded area, the part of the image that will be eliminated. This allows you to adjust the image area if desired before cropping the image. The result, before clicking on the Commit key on the right side of the Options bar, appears as seen in Fig. 3.
    * When Image Rotation or Straighten is used to tilt the image, each of which also shows blank areas created by the rotation, consider using the Content Aware Fill command,
    An oldie but goodie: Crop & Straighten
    The image below shows the result when File > Automate > Crop & Straighten Photos was applied to a three-image gang scan. Note that:
      1. Each print has clearly defined sides.
      2. Each print was separated from the others by at least a half-inch.
    This command creates a separate file for each cropped image and leaves the original file intact.

  • How do I rotate an image in Lightroom Mobile for the iPhone?

    Hi,
    Maybe I am missing something obvious, but I can't figure out how to rotate any images in Lightroom Mobile for the iPhone. The documentation is for the iPad and shows a rotate control on the right hand side of the screen, but no such control is showing up on the phone. I tried various numbers of fingers to just spin the image, but no luck. Can someone please let me know how this is supposed to work?
    Thanks!

    Hey, thanks!
    I had tried forever to figure that out. I could rotate up to about 45 degrees or so, but even that was hard to control.
    Thanks for the help.

  • Manipulating (Rotating) an Image with a button in Java

    I'm trying to display an image in a BorderLayout, and also I want a button on the layout that, when pressed, will rotate the image. I'm not sure how to create an image and be able to add it to a JFrame because when I do so, using something like:
    Image img = new Image("myPic.gif");
    myFrame.add(img, BorderLayout.CENTER);
    I just end up getting a compiler error. I could use a seperate class and draw the image in the paintComponent method, but I'm not sure how I add both the image and a button with which I can manipulate the image in the same class (I am assuming I need to use an ActionListener on the button to control the image, and if this is the case I am assuming they need to be in the same class). Can someone point me in the right direction here?
    Thanks,
    Alex
    [email protected]

    put the image in a JPanel subclass as you mention above and have a public method in this class that rotates the image. Then just have the button call this object's rotate method. OOP to the rescue.

  • Rotate both image and a panel drawan on it

    Hi all,
    I need to perform this task:
    1. Display an image on the screen
    2. Position a Jpanel on the image
    3. Rotate the Image with the help of mouse
    4. JPanel should be rotated accordingly.
    I need help regarding the classes to use to perform it.
    Thanks in advance,

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class SpinningContext extends JPanel {
        BufferedImage image;
        double theta = 0;
        SpinningContext(BufferedImage image) {
            this.image = image;
            setLayout(null);
            JPanel panel = new JPanel();
            panel.setBackground(Color.red);
            Dimension d = getPreferredSize();
            int w = 40;
            int h = 50;
            int x = (d.width - w)/2;
            int y = (d.height - h)/2;
            panel.setBounds(x, y, w, h);
            add(panel);
        protected void paintComponent(Graphics g) {
            int w = getWidth();
            int h = getHeight();
            int x = (w - image.getWidth())/2;
            int y = (h - image.getHeight())/2;
            g.drawImage(image, x, y, this);
        public void paint(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            Rectangle r = getBounds();
            g2.setColor(getBackground());
            g2.fill(r);
            double x = r.getCenterX();
            double y = r.getCenterY();
            AffineTransform at = AffineTransform.getRotateInstance(theta, x, y);
            g2.setTransform(at);
            super.paint(g);
        public Dimension getPreferredSize() {
            return new Dimension(400,400);
        public void setTheta(double theta) {
            this.theta = theta;
            repaint();
        public static void main(String[] args) throws IOException {
            String path = "images/geek/geek----t.gif";
            BufferedImage image = ImageIO.read(new File(path));
            SpinningContext test = new SpinningContext(image);
            ContextSpinner spinner = new ContextSpinner(test);
            test.addMouseListener(spinner);
            test.addMouseMotionListener(spinner);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.pack();
            f.setLocation(200,200);
            f.setVisible(true);
    class ContextSpinner extends MouseInputAdapter {
         SpinningContext component;
         Point2D.Double center = new Point2D.Double();
         boolean dragging = false;
         double theta;
        ContextSpinner(SpinningContext sc) {
            component = sc;
        public void mousePressed(MouseEvent e) {
            Rectangle r = component.getBounds();
            center.setLocation(r.getCenterX(), r.getCenterY());
            theta = getTheta(e.getPoint());
            dragging = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
        public void mouseDragged(MouseEvent e) {
            if(dragging)
                component.setTheta(getTheta(e.getPoint())-theta);
        private double getTheta(Point p) {
            double dy = p.y - center.y;
            double dx = p.x - center.x;
            return Math.atan2(dy, dx);
    }Image from:
    http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html

Maybe you are looking for