Results 1 to 3 of 3
  1. #1
    cataphract is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Need help rotating a non-preset number of images.

    Hi,
    I am working on a program currently that scans the files inside a folder, then loads all images from within that folder, and rotate those images 90 degrees before finally displaing them on JFrame.

    I've got the file loading and buffered images all sorted out, however I cannot figure out how to rotate an number of images as all options I've found so far involves using Graphics2D which could not be instantiated, meaning I cannot make an array of X number of Graphics2D objects.

    Is there a way to make this work?

    Thanks.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,197
    Rep Power
    19

    Default Re: Need help rotating a non-preset number of images.

    Construct a new BufferedImage with the width/height of the original image's height/width and appropriate type (ususally TYPE_INT_ARGB)
    Obtain its associated Graphics / Graphics2D via the appropriate method (read the API)
    Rotate the g2D 90 about the center of the image
    Draw the original image onto the new image

    Nowhere do you need
    an array of X number of Graphics2D objects.
    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,197
    Rep Power
    19

    Default Re: Need help rotating a non-preset number of images.

    Moved from AWT/Swing

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Counting total number of images in a website
    By sharifiit in forum Networking
    Replies: 0
    Last Post: 04-30-2011, 08:20 AM
  2. Quick rotating images question
    By sgthale in forum New To Java
    Replies: 5
    Last Post: 04-10-2011, 05:47 AM
  3. Rotating Images
    By Unome in forum Java Applets
    Replies: 3
    Last Post: 03-30-2009, 04:55 PM
  4. Rotating an image
    By lackofcolor in forum Java 2D
    Replies: 3
    Last Post: 02-27-2009, 11:54 PM
  5. Rotating Image?
    By sciguy77 in forum Java Applets
    Replies: 9
    Last Post: 02-17-2009, 01:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •