Question regarding drawing an Image

Discussion in 'Java' started by CooperFan9390, Jul 4, 2006.

  1. Hi,

    I have a problem I would like some help with. My java program reads a
    BMP, removes the header and stores the pixeldata in a 3-dimensional
    int-array. (int[y][x][3] : where 3 pixelvalues are stored in the last
    array)

    Now, I would like to draw this image in a JWindow or JFrame, (doesn't
    really matter) and thought it would be possible using
    MemoryImageSource. I'm only a beginner and have not been able to find a
    good documentation about this. Can anyone help me out?

    - Luuk
    CooperFan9390, Jul 4, 2006
    #1
    1. Advertising

  2. CooperFan9390

    Oliver Wong Guest

    "CooperFan9390" <> wrote in message
    news:...
    > Hi,
    >
    > I have a problem I would like some help with. My java program reads a
    > BMP, removes the header and stores the pixeldata in a 3-dimensional
    > int-array. (int[y][x][3] : where 3 pixelvalues are stored in the last
    > array)
    >
    > Now, I would like to draw this image in a JWindow or JFrame, (doesn't
    > really matter) and thought it would be possible using
    > MemoryImageSource. I'm only a beginner and have not been able to find a
    > good documentation about this. Can anyone help me out?


    Read the example at

    http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/MemoryImageSource.html

    and see the doc for

    http://java.sun.com/j2se/1.5.0/docs...geSource.html#MemoryImageSource(int, int, int[],%20int,%20int)

    If you have further questions, let me know.

    - Oliver
    Oliver Wong, Jul 4, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. newbie
    Replies:
    1
    Views:
    512
    newbie
    Mar 17, 2006
  2. anastasia
    Replies:
    4
    Views:
    17,530
    atalas
    Apr 18, 2008
  3. Replies:
    1
    Views:
    619
    Kevin Spencer
    Jan 9, 2006
  4. byrd48
    Replies:
    0
    Views:
    3,549
    byrd48
    Jul 6, 2006
  5. defn noob
    Replies:
    1
    Views:
    369
    Mark Space
    Jun 28, 2008
Loading...

Share This Page