• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic