Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By Norm
  • 1 Post By DarrylBurke

Thread: Crop many images out of one image? Please help!

  1. #1
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    4

    Default Crop many images out of one image? Please help!

    I just figured out how I can crop an image in Java using the following code:
    Java Code:
    *Picture* = createImage(new FilteredImageSource(*Picture*.getSource(), new CropImageFilter(0, 0, 50, 50)));
    Now I need some help with giving it specified parts, so that I can get out more than one image from this single image.
    Right now it is just cropping the current image. When you're using it you just type in *Picture* & it will get used.

    So what I want is pretty much an array of those images cropped from the same one.

    Thanks!
    Ah
    Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,274
    Rep Power
    25

    Default Re: Crop many images out of one image? Please help!

    Sorry, I don't know where your problem with doing this is. It seems its just some simple steps that you must know how to do:
    Do you know how to create an array of the image object? Or perhaps an arraylist
    Do you know how to address elements in that array?
    Can you create an image object? The posted code looks like it does that.

    Put those steps together,figure out how to vary the x,y, width and height for the region of the image you want and make a loop to do it.
    Alerhau likes this.

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

    Default Re: Crop many images out of one image? Please help!

    Is that Java or something else? What are the asterisks around Picture supposed to do?

    what I want is pretty much an array of those images cropped from the same one.
    If that's Java -- check out BufferedImage#getSubimage(...)

    db
    Norm likes this.

  4. #4
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    4

    Default Re: Crop many images out of one image? Please help!

    I solved it, I did as you said "Norm". I created an array of images & just cutted parts of each image out.
    Thanks!
    Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".

Similar Threads

  1. How to show image on images
    By johny2011 in forum AWT / Swing
    Replies: 5
    Last Post: 05-19-2011, 01:51 PM
  2. image web query from text argument? Like google images?
    By minime12358 in forum New To Java
    Replies: 0
    Last Post: 03-08-2011, 02:28 AM
  3. Replies: 0
    Last Post: 12-16-2010, 05:14 PM
  4. Replies: 4
    Last Post: 12-16-2010, 04:32 PM
  5. Replies: 0
    Last Post: 01-08-2008, 05:29 PM

Posting Permissions

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