How to rotate to landscape with accelerometer?

Hi
I didn't figure it out how I determine the orientation with the accelerometer. Because the autorotation is not good for my application.
Could you help me with this code?
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
acceleration.y
acceleration.z //Which of these three gets the rotation Landscape
acceleration.x
if(LandscapeOrientation) {
[landscapeView setAlpha:1]; //How do I rotate the view??
} else {
[landscapeView setAlpha:0];

Your best shot would be to make a copy, enable layout adjustment, and change the page dimensions, I think, but I wouldn't expect any miracles.

Similar Messages

  • How can I mix landscape with portrait pages in InDesign CS3?

    I want to put together a very simple four-page document with images and accompanying captions, to be inserted as plates into the middle of a book. Unfortunately, I don't seem to be able to find a way of mixing portrait and landscape images. The first page is a recto, and the will contain a single landscape image, so the caption needs to run vertically along the page edge (away from the margin); the second page will have two "landscaped" images, but one above the other, so the captions will run horizontally on the page (so that page isn't a problem at all); and then another page resembling the initial recto; and then a final page (verso) with the caption running along the left-hand edge (so it's landscape, but the other way around).
    I can't help feeling I've made a bit of a meal of explaining what I mean... but I hope it's clear enough! And not that unusual a requirement for a series of illustrations or tables within a text - so I'm sure I'm just being dim; but I have googled this quite extensively, and it seems not to be as obvious as I thought it might...

    Thanks for the quick reply! Rather than mock it up, I think I can explain it much more simply (sorry - it's 5.30 am where I am, and I've been working all night, so probably not very coherent... !). Basically, it's just the very familiar thing of having a group of plates in the middle of a book (not part of the pagination of the book itself, so I'm putting them together in a separate and - I hope! - single indd file). Where you have images that are landscape in their proportions, they need to be rotated 90 degrees, so that you then turn the book sideways to read the caption beneath the image. If it's a recto page, you turn it clockwise, if it's verso, anti-clockwise. Does that make sense? I have two of the former and one of the latter, plus a page with two images that will be set together on a single page, one above the other, which don't pose a problem, as "up" will remain "up", as it were...
    Is that any clearer? (!!?)

  • How to rotate text together with a Rectangle2D?

    Hi forum
    I hope you can help me out here. See the follow code example. I have a Rectangle2D, in which some text is rendered. What I'm trying to do here is the following: rotate the Rectangle2D - no problem here - but the text should follow - ie. still be rendered the same way inside the Rectangle2D after the rotation transform is applied. The theta value is just an example - it should work the same for any theta value.
    Ie - after the rotation, the text is drawn with the first letter just right of the left angle of the rotated Rectangle2D, just as with the original drawn text.
    I'm aware, that the key to doing this is to figure out what point to rotate the text around. I would believe, that the correct answer would be the same point as the Rectangle2D, but that doesn't seem to work, as you can see, if you run the code. Can someone help me to get this to work correctly?
    Any help would be appreciated! Thanks in advance!
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ScaleToFill extends JPanel {
        Rectangle2D.Float rect = new Rectangle2D.Float(200,200,220,35);
        float theta = 1.1748778437843f;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(Color.blue);
            Font font = g2.getFont().deriveFont(18f);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            String s = "This text should be rotated";
            float width = (float)font.getStringBounds(s, frc).getWidth();
            LineMetrics lm = font.getLineMetrics(s, frc);
            float height = lm.getAscent() + lm.getDescent();
            // Draw text as-is.
            // Scale text into rect.
            float xScale = rect.width / width;
            float yScale = rect.height / height;
            // Locate string origin.
            double x = rect.x;
            double y = rect.y + rect.height - yScale*lm.getDescent();
            AffineTransform at = AffineTransform.getTranslateInstance(x, y);
            float scale;
            if (xScale > yScale)
              scale = yScale;
            else
              scale = xScale;
            at.scale(scale, scale);
            AffineTransform rotator = new AffineTransform();
            rotator.rotate(theta, rect.getX()+(rect.getWidth() / 2), rect.getY()+(rect.getHeight() / 2) );
            GeneralPath rect2 = new GeneralPath(rotator.createTransformedShape(rect));
            g2.draw(rect);
            g2.draw(rect2);
            g2.setFont(font.deriveFont(at));
            g2.setPaint(Color.red);
            g2.drawString(s, 0, 0);
            at.rotate(theta, rect.getX()+(rect.getWidth() / 2), rect.getY()+(rect.getHeight() / 2) );
            g2.draw(rect2);
            Font rotateFont = font.deriveFont(rotator);
            g2.setFont(rotateFont);
            g2.setPaint(Color.red);
            g2.drawString(s, 0, 0);
            // Check scaled string bounds.
        public static void main(String[] args) {
            ScaleToFill test = new ScaleToFill();
            test.setPreferredSize(new Dimension(800,600));
            JFrame f = new JFrame();
            f.getContentPane().add(test);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setVisible(true);
            System.out.println(new Color(0,255,0,0));
    }

    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class STF extends JPanel {
        Rectangle2D.Float rect = new Rectangle2D.Float(200,200,220,35);
    //    float theta = 1.1748778437843f;
        double theta = Math.PI/6;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                                RenderingHints.VALUE_FRACTIONALMETRICS_ON);
            g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
                                RenderingHints.VALUE_STROKE_PURE);
            g2.setPaint(Color.blue);
            Font font = g2.getFont().deriveFont(18f);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            String s = "This text should be rotated";
            float width = (float)font.getStringBounds(s, frc).getWidth();
            LineMetrics lm = font.getLineMetrics(s, frc);
            float height = lm.getAscent() + lm.getDescent();
            // Scale text into rect.
            float xScale = rect.width / width;
            float yScale = rect.height / height;
            float scale = (xScale > yScale) ? yScale : xScale;
            // Locate string origin.
            double x = rect.x;
            double y = rect.y + (rect.height + scale*height)/2 - scale*lm.getDescent();
            AffineTransform at = AffineTransform.getTranslateInstance(x, y);
            at.scale(scale, scale);
            AffineTransform rotator = new AffineTransform();
            rotator.rotate(theta, rect.getCenterX(), rect.getCenterY());
            GeneralPath rect2 = new GeneralPath(rotator.createTransformedShape(rect));
            // Draw with no rotation.
            g2.draw(rect);
            g2.setPaint(Color.red);
            g2.setFont(font.deriveFont(at));
            g2.drawString(s, 0, 0);
            // Rotate once.
            g2.setPaint(Color.blue);
            g2.draw(rect2);
            rotator.concatenate(at);
            g2.setFont(font.deriveFont(rotator));
            g2.setPaint(Color.red);
            g2.drawString(s, 0, 0);
            // Rotate again.
            rotator.setToIdentity();
            rotator.rotate(2*theta, rect.getCenterX(), rect.getCenterY());
            rect2 = new GeneralPath(rotator.createTransformedShape(rect));
            g2.setPaint(Color.blue);
            g2.draw(rect2);
            rotator.concatenate(at);
            g2.setFont(font.deriveFont(rotator));
            g2.setPaint(Color.red);
            g2.drawString(s, 0, 0);
            // Check scaled string bounds.
            // this was handled by the fractional metrics rendering hint
        public static void main(String[] args) {
            STF test = new STF();
            test.setPreferredSize(new Dimension(800,600));
            JFrame f = new JFrame();
            f.getContentPane().add(test);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setVisible(true);
    }

  • IPhone 6 plus won't rotate to landscape - small lock with circle around it

    I have an iPhone 6 plus - and I have an small icon that is a padlock with a circle around it - how do I unlock the screen orientation lock?

    Can I assume that when the iPhone Screen is rotated to Landscape, and the display adjusts appropriately, users are then Swiping Up from the Bottom [now Long edge], then hitting the Lock-Unlock Icon, and the iPhone is Locked into Landscape?
    If I do, as described, the Swiped Up Control Centre covers the entire screen.
    When I hit the Lock-Unlock Icon a blurred image of the Display can be seen Rotating back to Portrait View.
    I am being very careful to ensure that the iPhone remains horizontal during the above action.
    To Close the Control Centre I have to Swipe it Downward form the Top [now Long Edge].
    Now being forced to revert to using Portrait View I Swipe Up for the Bottom [now Short Edge].
    When the Lock-Unlock Icon is hit a Message pops up saying the Portrait View has been Unlocked.
    Clearly these actions are not producing the results expected in my case.
    I would appreciate being able to use the iPhone Locked in Landscape View because of the need to view Bus Timetables very frequently.
    Any suggestions as to what I may be doing wrong, or actions toward resolution will be greatly appreciated.
    Cheers,
    FG

  • PE 10 how do I make template for landscape with 5 frames??

    In Elements 10 I am trying to get a landscape layout with 5 photos.  It appears as a choice in layout, but when selected it is a portrait with 5 photos.  The page can not be rotated, believe me I have tried!!  It existed in Elements 9 but not in Elements 10.  Can someone tell me how to make a simple template of landscape with 5 frames so it drops the pictures in for me??    My fingers are crossed.  Thanks!  CJSM

    That sure looks like a bug with that template, but once you click "Done" and save the collage as a PSD file, you can open it and do the following:
    Image...Rotate...90d Right to put everything into Landscape orientation.
    In the Layers Palette, click the top image layer, hold down your Shift key and click the bottom image layer to select all the image layers.
    Image...Rotate...Layer 90d Left to orient the photos into landscape.
    Use the Move tool (all the image layers are still selected) to move the images relative to the background.
    Barbara, the collage in PSE10 here automatically filled in the photo areas with the open photos.
    Ken

  • Problem with rotation and landscape mode in iOS 8

    From start of iOS 8 I have got problem with rotation in my iPhone 5S 32GB as well as in my iPad mini retina 32GB. Automatical rotation to landscape mode is not working correctly. For example if you take the phone or tablet to landscape mode in base display and tap to Safari, Mail, Messages, the app will start but stay in normal mode, not landscape. Then you have to back the phone to normal portrait mode and back to landscape and only then the phone do the landscape mode. I have never seen this problem in iOS 7 or older.
    Could you help me anyone with this problem? Or is the problem generally in iOS 8.
    Thanks a lot
    Jakub

    Brian, thanks, but it's not a rotation lock issue - at least not relating to the rotation lock setting. It's just a general use setting. Right now i have my iPhone propped in landscape mode. If I now hit the home button, essentially returning to a portrait setting though my phone is still positioned in landscape, then open any other app that supports landscape, that app WILL NOT orient itself to landscape mode. It will stay in portrait mode. The phone has to be physically oriented to portrait, then back to landscape for the app to register landscape mode properly. This is a glitch, and not a rotation lock issue. it ought to be noted that this was not an issue in iOS 7 or any previous iteration.

  • Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Numbers does not have rotated text within cells.  You can place a text box over the cell that has rotated text but you cannot rotate text within a cell.

  • Home screen won't rotate to landscape

    I thought that my home screen would rotate into landscape mode when I first got the phone, but it will no longer do so.  This happens on the home screen and in the app drawer.  When my phone is in the desktop cradle it rotates just fine.  When I am in an app such as messaging or the browser it rotates also with no problem.
    Auto rotation is checked in settings - display.
    Anyone know why this might be happening or how to fix it?  I sometimes prefer to hold my phone in landscape mode depending on how I am using it.

    JoeNe,
    This appears to be an artifact of the OS.  I tried to duplicate the situation, and was easily able to.  Also, the dialer screen does not rotate.
    I use a desk dock for the phone, and when docked the Apps screen, the dialer screen and the home screens all rotate (the phone is docked in an orientation with its left side down).  So I think this is part of the design of the OS.
    Perhaps not to your liking, but I don't think this is considered a malfunction.

  • Smart form rotate 90 degrees with Zebra printer

    Hi Experts,
    We are using smart form to design label which need be printed by Zebra printer, and the label need be printed in landscape. Currently we are using the Zebra command '^FWR' in smartform to rotate the field in each window, but the rotated format is very strange. Can anyone let me know how the rotate command work?
    It would be highly appreicated if an rotate example can be provided.
    Many thanks.
    Benny.

    The Zebra command ^FWR rotates each individual field by 90 degrees (clockwise). But then you'll have to adjust position of each field again for landscape output.
    In ZPL II printer language is no command for rotating label by 90 degrees. The printer driver doesn't understand "orientation=LANDSCAPE".
    A slightly better solution could be to define a smartform with portrait orientation. Add a "command node" in first window and enter attribute name "S_LZPL_SETUP" with value '^FWR'.
    Please note that this command doesn't has an effect on barcodes. They have their own parameters for rotation. Please define these parameters in SE73 for each barcode type your're using.
    Steffen

  • How to rotate images tacken by iPad?

    Apple iPad MD513TA/T
    Over a thousand pictures have been taken by this iPad, but all upside down.
    Some of the pictures have been coppied/pasted to PC and have been tested for rotating by Windows Office Picture Manager. 
    The Office Picture Manager could display the pictures but its rotating function was nonfunctional for these pictures.
    How to rotate the pictures taken by iPad?  On iPad?   On PC?
    Thanks.

    If this happens on Windows systems it is because the Windows Photo Viewer and Live Photo Gallery may ignore the EXIF orientation of the photos. This data tells the viewer which way is up.
    See here for discussion and details from Microsoft on how this may be fixed on Windows:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-pictures/windows-phot o-viewer-or-live-photo-gallery-does/a161c8da-c1ce-4347-a92e-724f9e535c15
    You can also avoid this problem by taking photos in landscape mode with the iPhone/iPad held with the Home button to the right. In portrait mode keep the Home button down.

  • HT201401 how to rotate a video after recording on my iphone

    how to rotate a video after recording on my iphone?

    Import the video with your computer as with any other digital camera and you can use a video viewing/editing app on your computer to rotate the video.
    For what purpose?

  • How to rotate a Video in WindowsPhone 8.1 Silverlight

    Hi,
    Let me explain my problem.
    I want to record video without shutter sound, so i choice CaptureSource  instead of
    MediaCapture.
    With MediaCapture i can set SetPreviewRotation(VideoRotation) to
    change to rotate of video, the problem is with CaptureSource,
    i can't do that.
    So i looking for some way to rotate a video.
    With library, maybe ffmpeg is the right way, but i can't use it with WP.
    Anyone can tell me how to rotate a video, please ?

    Since you didn't share any code, I hope this works for you. They key here is to rotate the VideoBrush.
    //check if webcam is detected
    if (captureSource.VideoCaptureDevice != null)
    captureSource.Start();
    //RotateTransform
    RotateTransform aRotateTransform = new RotateTransform();
    aRotateTransform.CenterX = 0.5;
    aRotateTransform.CenterY = 0.5;
    aRotateTransform.Angle = 90; //set this value to what you need
    //create a videobrush
    VideoBrush vBrush = new VideoBrush();
    //set the rotate transform to VideoBrush relativetransform
    vBrush.RelativeTransform = aRotateTransform;
    //set it to us the capture source
    vBrush.SetSource(captureSource);
    //fill the rectangle with the video brush contents
    vRect.Fill = vBrush;
    Hope it works.
    Abdulwahab Suleiman

  • How to rotate pencil mark in Acrobat X?

    How to rotate pencil mark in Acrobat X?
    When I am coping pencil mark between pdfs it auto-rotates into horizontal position.
    Thanks in advance.
    Greg

    Hey,
    Can you please share the snapshots of both PDF pages with pencil marks before and after rotation.
    Regards,
    Anubha

  • How to Insert a Landscape Page Into a Portrait Document?

    How to Insert a Landscape Page Into a Portrait Document?
    i use pages 5.2
    thanks

    You can't.  But you could add a text box and rotate it (select the box, click arrange, rotate).

  • How to create a "text with photos" book in Elements 8?

    Hello all!
    I am new to APE and this forum; I've been reading about it (APE 7, for the most part - right now I'm reading "The Missing Manual" for version 7), and have pre-ordered version 8.
    I have published many books in the past on lulu.com, but none of them contained photographs; my current book will also include many photographs (it's about half text and half photos); I'm wondering if there's a better way to create it -- using APE 8 -- than my normal method, which is to use Open Office Writer to create the document (inserting pictures from files where appropriate, I guess), and then, as a final step, converting the document to a .PDF and uploading that.
    I am thinking that what I should be able to do is have an underlying base layer that is an image with low opacity, and on top of that a layer that is my text. I could rotate the "landscape" images prior to adding them to fit the document's layout. Is this the [best] way to do this? A concern I have about that method is that then every page is a photograph -- which could make the download size enormous (instead of simply semi-enormous).
    Thoughts?

    You can simulate it, although it might not be what you look for...
    Example (buggy but that's just a proof of concept):
    class MulticolorText extends CustomNode
      var text: String;
      var colors: Color[];
      var font: Font;
      override public function create(): Node
        HBox
          var l = text.length() / sizeof colors;
          content: for (i in [ 0 ..< sizeof colors])
            Text { content: text.substring(i * l, (i + 1) * l), fill: colors, font: font }
    // Used as:
    MulticolorText
    text: "Multicolor"
    font: Font { size: 36 }
    translateX: 20
    translateY: 20
    colors: [ Color.rgb(200, 0, 25), Color.rgb(0, 200, 75), Color.rgb(200, 200, 125), Color.rgb(0, 0, 175), Color.rgb(0, 0, 225)  ]

Maybe you are looking for