Question regarding drawing an Image

C

CooperFan9390

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
 
O

Oliver Wong

CooperFan9390 said:
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...#MemoryImageSource(int, int, int[], int, int)

If you have further questions, let me know.

- Oliver
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top