This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How can I load a gif and draw something on it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How can I load a gif and draw something on it?" Watch "How can I load a gif and draw something on it?" New topic
Author

How can I load a gif and draw something on it?

fabio gomes
Greenhorn

Joined: Jul 02, 2001
Posts: 1
I'm trying to load a gif and draw something over the image but I can't because the getGraphics doesn't work with getImage, it works only with createImage.
Can somebody help me?
jane stockdill
Greenhorn

Joined: Jul 04, 2001
Posts: 3
You can always layer it so you have a frame and in the frame you place a panel - in the panel you draw the gif. Then also in the frame you have the other things that you want to draw. You will however nee to have a null layout in the frame so that you can place components on top of each other. This works for the work i'm dong where i have a gif in the background and then text boxes and labels on top of the image. Hope this might work for you.
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
In that case, you can load the Image through a MediaTracker instance, then create another Image using Frame's createImage(). Then draw the loaded Image UPON the Frame's Image using the new Image's Graphics object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I load a gif and draw something on it?
 
Similar Threads
together j for scea part2
Dealing with images
images
drawImage to Panel
Rendering Shapes/texts over Images