Rotating an image

Im making a blackjack game and for the double function i need the card image to be rotated 90 degrees.
But I have rarely worked with graphics so I need some help.
I have found this code on a site:
Graphics2D g2d = (Graphics2D)g;
// Move the origin to the center of the circle.
// g2d.translate(300, 270);
  // Rotate the coordinate system around current
  // origin, which is at the center of the circle.
  g2d.rotate(Math.PI/8.0);
g2d.drawString("Javaaaaaaaaaaaa", 0, 0);This draws the string Javaaa all over the place. Obviously not what i want. It should simply draw it once 90 degrees turned.
Tips, advice or code would be very appreciated.

If I remember well, since it is rotated, the direction of the printing varies because
of the angle, so if I'm not wrong, this might be the explanation.
Before rotating, your origin was (case A)
(0,0)
|
|
|After rotated, your origin, now is (case B)
|
|
|___________
(0,0)And the drawImage is always considering the first case.
Hope it helps, if you find I was wrong and get the answer, please reply back.

Similar Messages

  • How do i rotate an image in keynote?

    Im trying to rotate an image in keynote bc im making a collage and i dont want all my images straight up and down. Does anyone know how to do that?

    Nevermind i figured it out =)

  • My video was recorded on my I phone 4, the camera was held sideways for a horizontal view, but loads in I movie vertically.  How can I rotate the image so it is horizontal?

    My video was recorded on my I phone 4, the camera was held sideways for a horizontal view, but loads in I movie vertically.  How can I rotate the image so it is horizontal?

    Drag the clip from your Event to your Project. Then use the Rotate, Crop, Ken Burns Tool on the Middle Toolbar to rotate it

  • Partial rotation of images when importing...

    I'm wondering how to stop Lightroom from "squaring up" my images when I import them.  Attached is a screen shot to illustrate.
    I also can't find any consistentency, if I import the same image three times it will be as above twice but not on the third time!
    I'm wondering if this is a metadata thing?
    BTW camera is a Nikon D600.
    With thanks in advance,
    -Simon

    If this is only happening to a few of the images on import it is most likely something related to your camera. If ALL of the Imported images exhibit the issue then there are two things in LR that could cause this to happen:
    1) You are applying a Develop preset on Import that has  Lens Corrections> Manual> Rotate tool setting other than '0.'
    2) Your LR 'Default Develop Settings' has a Crop Angle tool or Lens Corrections> Manual> Rotate tool setting other than '0.'
    To check this import one of the images from CF card that shows the rotation. Examine the Crop Angle tool and Lens Corrections> Manual> Rotate tool settings to determine which one is being applied. From inside the Develop module with the imported image still rotated hit the master 'Reset' button at the bottom of the right-hand Develop panel. This applies your LR 'Default Develop Settings.'
    a) If the image is still rotated you may have inadvertently updated your LR 'Default Develop Settings' in the past with the image rotated. To correct this simply hit the master 'Reset' button, reset both the Crop Angle tool and Manual Rotate tools to '0,' go to toolbar Develop> Set Default settings, and select 'Update to Current Settings.'
    b) If the image is not rotated you are probably applying a Develop preset that was inadvertently created with the image rotated. You will need to recreate this preset making sure Lens Corrections> 'Transform' is unchecked. This is the only Develop preset setting that will rotate the image as in your example.
    If neither a or b fixes the issue you can try resetting your LR Preferences file:
    http://members.lightroomqueen.com/Knowledgebase/Article/View/1148/198/how-do-i-delete-the- lightroom-preferences-file

  • Can anyone help me to add method to rotate the image using mouse?

    Hi everyone, i am currently creating a game which require the user to be able to drag and rotate the image
    on the screen..but sadly...i'm only able to do the dragging part..
    Can anyone be able to help me add the method to rotate the image using the mouse?
    Thanks :-)
    the code
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    class Game extends JFrame {
         DisplayCanvas canvas;
         public Game() {
              super("My Game");
              Container container = getContentPane();
              canvas = new DisplayCanvas();
              TitledBorder border = new TitledBorder("Game Window");
              border.setTitlePosition(TitledBorder.BOTTOM);
              canvas.setBorder(border);
              container.add(canvas);
              addWindowListener(new WindowEventHandler());
              setSize(450,400);
              show();
              class WindowEventHandler extends WindowAdapter {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              public static void main(String arg[]) {
                   new Example();
         class DisplayCanvas extends JPanel {
              int x, y;
              BufferedImage bi;
              DisplayCanvas() {
                   setBackground(Color.white);
                   setSize(450,400);
                   addMouseMotionListener(new MouseMotionHandler());
                   Image image = getToolkit().getImage("duke.gif");
                   MediaTracker mt = new MediaTracker(this);
                   mt.addImage(image, 1);
                   try {
                        mt.waitForAll();
                   catch (Exception e) {
                        System.out.println("Exception while loading image.");
                   if (image.getWidth(this) == -1) {
                        System.out.println("***Make sure you have the image "
                        + "(duke.gif) file in the same directory.*****");
                        System.exit(0);
                   bi = new BufferedImage(image.getWidth(this),
                   image.getHeight(this),
                   BufferedImage.TYPE_INT_ARGB);
                   Graphics2D big =bi.createGraphics();
                   big.drawImage(image, 0, 0, this);
              public void paintComponent(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2D = (Graphics2D) g;
                   g2D.drawImage(bi, x, y, this);
              class MouseMotionHandler extends MouseMotionAdapter {
                   public void mouseDragged(MouseEvent e) {
                        x = e.getX(); y = e.getY();
                        repaint();

    research a bit on AffineTransforms. you can set the rotated instance of the Graphics2D class and it will do the rotations for you :-D

  • Rotating an image and getting back the image...

    Hi,
    I have a small problem using images...
    1. I have an existing image...
    2. I need to rotate the image by a certain angle(say 60 degree)....
    3. Return the rotated image back to the calling routine...
    My problem is that I can rotate the image using the AffineTransform, and draw the image immediately... but I cannot return the rotated image... can anyone help me out on this??????

    No sorry that didn't fix it. I forgot to mention that I already have a method in ImagePanel called clearImage()
         * Clear the image on this panel.
        public void clearImage()
            if(panelImage != null) {
                Graphics imageGraphics = panelImage.getGraphics();
                imageGraphics.setColor(Color.LIGHT_GRAY);
                imageGraphics.fillRect(0, 0, width, height);
                repaint();
        }But if I clear the panel and then try to apply the function nothing happens. The LIGHT_GRAY background remains.
    This is how I apply a function in the class[b] ImageViewer
         * Apply a given function to the current image
        private void applyFunction(Function function)
             if(currentImage != null) {     
                  if(function.getName().equals("Zoom In")) {
                       Zoom.ZOOMIN_RATE = 1.5;
                       function.apply(currentImage);
                  else if(function.getName().equals("Zoom Out")) {
                       Zoom.ZOOMIN_RATE = 0.5;
                       function.apply(currentImage);
                  else {          
                       imagePanel.clearImage();
                       function.apply(currentImage);    //A function is applied                   
                  frame.repaint();              
                  showStatus("Applied: " + function.getName());
             else {
                  showStatus("No image loaded.");
        }

  • Unable to rotate raw images in bridge, rotate buttons grayed out?

    Unable to rotate raw images in bridge, rotate buttons grayed out? 
    Bridge 5.0.2.4. 

    There is an ignore EXIF setting Preferences. I can't remember if that is Bridge or Photoshop, but IIRC it is for DNG files.
    Right.  Check Photosho > Preferences > File handling and make sure 'Ignore EXIF tag, is not checked.  I think that might do it, so long as it refers to sidecare files, because only RAW files would have one.

  • 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.

  • Rotating Multiple Images in Fireworks

    I have my home page designed in Fireworks MX 2004. I'd like
    to set a rotation of images (all same size) into my page. Can I do
    this in Fireworks?
    Previously I used a Java script from another source but after
    adding swap image behavior to my menu text my rotation script no
    longer works. I don't know Java well so I'm assuming the two
    scripts are stepping on each other toes somehow.
    Thank you for any input you may have,
    Tim

    Hi Tim,
    Unless you create a GIF animation with the images (not
    recommended for
    photos) you can't do this in Fireworks.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    Design Aid Kits:
    http://www.webdevbiz.com/pwf/index.cfm

  • 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.

  • Rotated transparent images Muse CC 2014 not compatible with IE8....  they all appear with a black box behind them.

    IE 8 is supposed to be supported by muse CC 2014 but its not in the case of rotated transparent images.. Did not have this problem in the previous version of Muse.  The code did not have progid:DXImageTransform.Microsoft.Matrix... now it does...
    Had to add ie8 specific css and code to the page and use a composite image instead of the individual images to get a page with no black boxes...
    . <!-- CSS -->     <!--[if lte IE 8]>     <link href="assets/money3/ie8.css" rel="stylesheet" type="text/css">     <![endif]--> 
    <!--[if lte IE 8]>       <div class="clearfix grpelem" id="u24742ie8">     <img src="images/composite2.png" alt=""/>      </div>    <![endif]-->     
    <!--[if gte IE 9]><!-->        <div class="clearfix grpelem" id="u24742"><!-- group -->       <div class="clearfix grpelem" id="u24686"><!-- group -->        <img class="grpelem" id="u24545" alt="" width="119" height="119" src="images/floating1000sgreen-u24545.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.8572,M12=0.515,M21=-0. 515,M22=-0.8572,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-22" data-mu-ie-matrix-dy="-22"/><!-- rasterized frame -->        <img class="grpelem" id="u24509" alt="" width="159" height="159" src="images/floating1000s2green-u24509.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.9744,M12=-0.225,M21=0.2 25,M22=0.9744,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-16" data-mu-ie-matrix-dy="-16"/><!-- rasterized frame -->        <img class="grpelem" id="u24503" alt="" width="184" height="184" src="images/floating1000sgreen-u24503.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.848,M12=-0.5299,M21=0.5 299,M22=0.848,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-35" data-mu-ie-matrix-dy="-35"/><!-- rasterized frame -->       </div>       <div class="clearfix grpelem" id="u24583"><!-- group -->        <div class="clearfix grpelem" id="pu24596"><!-- group -->         <img class="grpelem" id="u24596" alt="" width="58" height="58" src="images/floating1000s4-u24596.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.9703,M12=-0.2419,M21=0. 2419,M22=0.9703,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-6" data-mu-ie-matrix-dy="-6"/><!-- rasterized frame -->         <img class="grpelem" id="u24614" alt="" width="54" height="46" src="images/floating1000s2green-u24614.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.9744,M12=-0.225,M21=0.2 25,M22=0.9744,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-4" data-mu-ie-matrix-dy="-5"/><!-- rasterized frame -->         <img class="grpelem" id="u24640" alt="" width="53" height="62" src="images/floating1000s5-u24640.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.9781,M12=-0.2079,M21=0 .2079,M22=-0.9781,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-6" data-mu-ie-matrix-dy="-5"/><!-- rasterized frame -->         <img class="grpelem" id="u24618" alt="" width="39" height="39" src="images/floating1000sgreen-u24618.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.6018,M12=0.7986,M21=-0 .7986,M22=-0.6018,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-8" data-mu-ie-matrix-dy="-8"/><!-- rasterized frame -->         <img class="grpelem" id="u24620" alt="" width="39" height="39" src="images/floating1000sgreen-u24620.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.6018,M12=0.7986,M21=-0 .7986,M22=-0.6018,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-8" data-mu-ie-matrix-dy="-8"/><!-- rasterized frame -->         <img class="grpelem" id="u24610" alt="" width="115" height="119" src="images/floating1000sgreen-u24610.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.6428,M12=0.766,M21=-0. 766,M22=-0.6428,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-25" data-mu-ie-matrix-dy="-23"/><!-- rasterized frame -->         <img class="grpelem" id="u24604" alt="" width="29" height="29" src="images/single100-u24604.png"/><!-- rasterized frame -->         <img class="grpelem" id="u24588" alt="" width="34" height="39" src="images/floating1000s5-u24588.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.8572,M12=-0.515,M21=0.5 15,M22=0.8572,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-8" data-mu-ie-matrix-dy="-6"/><!-- rasterized frame -->         <img class="grpelem" id="u24632" alt="" width="49" height="49" src="images/single100-u24632.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.6691,M12=-0.7431,M21=0. 7431,M22=0.6691,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-10" data-mu-ie-matrix-dy="-10"/><!-- rasterized frame -->         <img class="grpelem" id="u24638" alt="" width="59" height="51" src="images/floating1000s5-u24638.png"/><!-- rasterized frame -->         <img class="grpelem" id="u24584" alt="" width="34" height="34" src="images/single100-u24584.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.8387,M12=-0.5446,M21=0 .5446,M22=-0.8387,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-7" data-mu-ie-matrix-dy="-7"/><!-- rasterized frame -->         <img class="grpelem" id="u24592" alt="" width="75" height="95" src="images/floating1000sgreen-u24592.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.2924,M12=-0.9563,M21=0. 9563,M22=0.2924,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-19" data-mu-ie-matrix-dy="-2"/><!-- rasterized frame -->        </div>        <img class="grpelem" id="u24602" alt="" width="19" height="19" src="images/single100-u24602.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=-0.7431,M12=0.6691,M21=-0 .6691,M22=-0.7431,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-4" data-mu-ie-matrix-dy="-4"/><!-- rasterized frame -->       </div>      </div>      <img class="grpelem" id="u24511" alt="" width="34" height="39" src="images/floating1000s5-u24511.png" data-mu-ie-matrix="progid:DXImageTransform.Microsoft.Matrix(M11=0.8572,M12=-0.515,M21=0.5 15,M22=0.8572,SizingMethod='auto expand')" data-mu-ie-matrix-dx="-8" data-mu-ie-matrix-dy="-6"/><!--<![endif]-->

    I see this is still an issue even after the latest update....  Will this problem be addressed?  Right now I have to manually update the html code for each page after export.    This is a site that I update regularly so every time a change is made I have to fix each page so it can be viewed without the black boxes in ie8.

  • Does rotating an image several times affect the quality?

    I'm using a template for a cd sleeve. One half of it is upside down so to work on the other half I have to rotate the image. I will have to rotate the image a hundred times before the project is finished.
    Does this affect the quality? If so, any workarounds for me?
    Thank you.

    As the previous poster said - use non-destructive transform methods wherever you can. Apart from that, note, that rotating in multiples of 90 degrees does not change the pixels' color and transparency information, as this always coincides with the imaginary rectangular/ square pixel grid and pixels only get re-arranged. Only rotations at different angles will enforce resampling, meaning that in particular edges will be recalculated to keep them visually smooth. Doing this multiple times will result in softening, as the way Photoshop works, it has no knowledge of previous transforms and will apply the full sampling again in a "dumb" manner. Smart objects avoid that limitation, as they concatenate operations, i.e. a rotation of +60 degrees followed by one -20 degrees will be treated as a single 40 degree rotation. Likewise, CS4's canvas rotation, is merely a secondary rotation applied to the screen buffer, not affecting the image itself.
    Mylenium

  • Rotating an image within a clipping path in Photoshop CS5

    When you have taken a photo of an image, then open it up in     Photoshop and realise its on a bit of an angle but you make a clipping path     around it first and save it, then afterwards want to rotate it - Is there a     way of linking the path with the image layer so they rotate together in     one step?,
    Or can you only rotate the image layer first then the path separately as     thats what I ended up doing?
    Hoping someone can help me and answer my question

    If your clipping path is stored in the Paths panel, then no. But you can select the path then go to Layer > Vector Mask > Current Path. Not transform the layer and the path is transformed, too. You can then open the Paths panel and drag the vector path onto the New Path button to duplicate it and make it a clipping path for the entire image.

  • Rotating JPEG images with feh [SOLVED]

    A funny thing happened to me using feh today.
    It seems it can't rotate JPEG images 90 degrees (neither clockwise, nor counterclockwise). Whenever I try (with different files), feh dies with the following error message:
    Bogus virtual array access
    It can do it if it's 180 degrees. It can also rotate PNG images 90 and 180 degrees without any problem.
    Did someone else experience this? Is the new libjpeg to blame? Should I open a bug report?
    Last edited by megadriver (2010-03-05 06:56:25)

    I'm not sure feh is actively developed/maintained any more, but you could email the author* - I'm sure he'd fix something like this. If indeed it is a bug (of course). Can't check myself, yet - will do later.
    Meantime check imagemagick (and the convert command), if you need an alternative.
    * though I'd be happy if I was wrong.

  • Rotating an image in memory

    Hi
    I need to rotate an image kept in a DB as a byte array. I have an Object holding the byte array of the image, and I want to create a new byte array holding the rotated image.
    I use the following code:
    private byte[] rotateImage(byte[] originalImageAsBytes , double radians) throws InternalException {
        ByteArrayOutputStream rotatedImageStream = null;
        try {
          BufferedImage originalImage = ImageIO.read(new ByteArrayInputStream(originalImageAsBytes)); // read the original image
          BufferedImage rotatedImage = new BufferedImage(originalImage.getHeight() , originalImage.getWidth() , originalImage.getType()); // create the rotated image
          AffineTransformOp rotationTransformOp = new AffineTransformOp(AffineTransform.getRotateInstance(radians),AffineTransformOp.TYPE_NEAREST_NEIGHBOR); // this AffineTransformOp is the actual "rotater"
          rotatedImage = rotationTransformOp.filter(originalImage,null); // perform the rotation
          // write the result
          rotatedImageStream = new ByteArrayOutputStream();
          ImageIO.write(rotatedImage, ImageIO.getReaderFormatNames()[0] , rotatedImageStream);
        } catch (IOException e) {
          throw new InternalException(e);
        return rotatedImageStream.toByteArray();
      }//rotateImageWhen I run this code I get the following exception:
    java.awt.image.RasterFormatException: Transformed height (0) is less than or equ
    al to 0.
    at java.awt.image.AffineTransformOp.createCompatibleDestImage(AffineTran
    sformOp.java:436)
    at java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:209)
    I tried to do the following:
    private byte[] rotateImage(byte[] originalImageAsBytes , double radians) throws InternalException {
        ByteArrayOutputStream rotatedImageStream = null;
        try {
          BufferedImage originalImage = ImageIO.read(new ByteArrayInputStream(originalImageAsBytes)); // read the original image
          BufferedImage rotatedImage = new BufferedImage(originalImage.getHeight() , originalImage.getWidth() , originalImage.getType()); // create the rotated image
          AffineTransformOp rotationTransformOp = new AffineTransformOp(AffineTransform.getRotateInstance(radians),AffineTransformOp.TYPE_NEAREST_NEIGHBOR); // this AffineTransformOp is the actual "rotater"
          rotationTransformOp.filter(originalImage,rotatedImage); // perform the rotation
          // write the result
          rotatedImageStream = new ByteArrayOutputStream();
          ImageIO.write(rotatedImage, ImageIO.getReaderFormatNames()[0] , rotatedImageStream);
        } catch (IOException e) {
          throw new InternalException(e);
        return rotatedImageStream.toByteArray();
      }//rotateImageBut this simply does not create the transformation. When I debug the the application I see that the filter method does not change the rotatedImage at all.
    Can anyone help please?
    10x

    I'm glad I'm discussing with myself here, but again - I have more input (I would be very grateful if someone could help as well...).
    I found out that what ruins my images is the type of interpolation I used. If I don't use the AffineTransformOp.TYPE_NEAREST_NEIGHBOR - the image is ruined.
    However, when I use the nearest neighbor interpolation, the quality of the image is degraded.
    This is the code I use now (that works but degrades the image), please feel free to let me know how can I use bilinear or bicubic interpolations, and still succeed my operation:
      private byte[] rotateImage(byte[] originalImageAsBytes , double radians) throws InternalException {
        ByteArrayOutputStream rotatedImageStream = null;
        try {
          BufferedImage originalImage = ImageIO.read(new ByteArrayInputStream(originalImageAsBytes)); // read the original image
          AffineTransform rotationTransform = new AffineTransform();
          rotationTransform.rotate(radians, originalImage.getWidth() / 2.0 , originalImage.getHeight() / 2.0);
          AffineTransformOp rotationTransformOp =
            new AffineTransformOp(rotationTransform , AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
          BufferedImage rotatedImage = rotationTransformOp.filter(originalImage,null);
          // write the result
          rotatedImageStream = new ByteArrayOutputStream();
          ImageIO.write(rotatedImage, "jpg" , rotatedImageStream);
        } catch (IOException e) {
          throw new InternalException(e);
        return rotatedImageStream.toByteArray();
    }//rotateImage

  • 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.

Maybe you are looking for

  • Pasted image not printing in Acrobat Pro 9

    I had no problems printing PDF pages with pated into them images in Acrobat 8. Now in version 9 I can still paste the image into the document, save doc and see it on the screen with no problem - but when printing the pasted image is gone. Any clues?

  • Same apple id on home iphone and business iphone

    My work is making me get a second phone. I will be getting an iphone, but want to somehow consolidate the mess. I will have two phone numbers, but one apple id (same person, so same contacts, etc). By using the same apple id am i able to consolidate

  • How to process for an ECC 6.0 upgrade for different objects (RICEF)?

    Hi eaxperts, I am new to upgrad project. Can anyone pls. tell me in details things that need to be undertaken in an ECC upgrade project for different objects e.g. RICEF and How should I process for the same? Please also tell me the important T-codes

  • Purchasing group transacting for multiple purchasing organizations

    Hi, I have a requirement in which i have certain purchasers defined as purchasing groups in my organizational structure. However, these purchasing groups perform sourcing transactions (e.g., bid invitation, auction) for multiple purchasing organizati

  • Convert alv to pdf and mail

    hi friends, i want convert the alv report to pdf and mail the same pdf. have used function REUSE_ALV_LIST_DISPLAY to display alv report. i am using CONVERT_ABAPSPOOLJOB_2_PDF to convert the alv report to pdf. now i need to mail the pdf implicitly to