Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do fast graphics?

Status
Not open for further replies.

imp

Programmer
Jul 24, 2000
9
US
I'm trying to do some animation with a pretty good frame rate. I've heard this can be done by doing all the "drawing" onto an array of ints (where each int represents the RGB(a) values of a pixel) and then dumping the array to a Component (Frame, Panel, etc.). I haven't been able to figure out, or find any examples of, how this (displaying an array of ints to a visible Component) is done. I believe this is done by making the int array the source for an Image's ImageProducer and having the Component display that Image, but I don't have a real good grasp of how ImageProducers work. I would call myself a beginner. (I have read books & tutorials, but have not had much experience writing Java.) Any assistance or suggestions would be greatly appreciated. Thanks.
 
For what you want to do have a look at the Java Media Framework version 1.1 (JMF1.1), which provides enhanced processing of images and audio (many formats)

Have a look at:


Then have a look at “Generating a Movie File from a List of (JPEG) Images” at:


Hope this will help you out
Billy H

bhogar@acxiom.co.uk
 
Another alternative is:

Create an array of ImageIcon, these can be GIF or JPEG
Code:
(myImages[I]=new ImageIcone(“filename”)
Use in instance of class Timer to control frame rate
Start at Image[0]
Then repaint on the Timers actionPerformed method
Use the paintComponent method and call the image[x].paintIcon method
Finally current image = next image

Billy H

bhogar@acxiom.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top