Results 1 to 4 of 4
  1. #1
    mzatanoskas is offline Member
    Join Date
    Feb 2009
    Posts
    5
    Rep Power
    0

    Default Loading jpegs into an array.

    Hi there,

    I'm completely new to Java and don't know much about programming in general.

    I'm trying to make a little program that will load a folder full of small jpegs, join them together to make a big image and then finally save the result as a jpg and png.

    My first step is to load each image into a multidimensional array ie myarray[x-value][y-value].

    So my question is, is this possible in Java? I had a look at the documentation and i only saw examples of integer, boolean etc arrays, not images/objects...

    Thanks for any help or advice!

    EDIT: Well in the mean time I've decided to just put the names of the jpegs in the array and then load them all individually later. I guess it will do.
    Last edited by mzatanoskas; 02-09-2009 at 07:57 PM.

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

    Default

    use ImageIO to read pics which produce BufferedImage
    BufferedImage.getData.getPixel(x, y , double[])

    read Images (The Java™ Tutorials > 2D Graphics > Overview of the Java 2D API Concepts)

    i dont think it is a good method or not...
    Last edited by mtyoung; 02-10-2009 at 10:23 AM.

  3. #3
    Zamppa is offline Member
    Join Date
    Feb 2009
    Location
    Finland
    Posts
    13
    Rep Power
    0

    Default

    Quote Originally Posted by mzatanoskas View Post
    So my question is, is this possible in Java? I had a look at the documentation and i only saw examples of integer, boolean etc arrays, not images/objects...
    Object arrays work, and thus Image arrays as well.

    Say,
    Image[][] imgArr = new Image[2][2];

  4. #4
    mzatanoskas is offline Member
    Join Date
    Feb 2009
    Posts
    5
    Rep Power
    0

    Default

    Thanks guys, I didn't see the object stuff on the pages discussing arrays.

Similar Threads

  1. class loading
    By purejoker in forum AWT / Swing
    Replies: 1
    Last Post: 01-20-2009, 12:09 PM
  2. loading JInternalFrames
    By vishakha in forum AWT / Swing
    Replies: 5
    Last Post: 07-23-2008, 03:58 PM
  3. loading a new Jframe
    By Ebylord in forum New To Java
    Replies: 0
    Last Post: 07-22-2008, 08:31 PM
  4. Loading Images - Imp
    By Thulasiraman in forum Advanced Java
    Replies: 0
    Last Post: 01-28-2008, 09:33 AM
  5. Help Loading Up Pictures
    By marco in forum Java Applets
    Replies: 3
    Last Post: 08-14-2007, 10:32 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
  •