• 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

mediatracker and streams

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm just learning to use Java2D to perform Affinetransforms on some images. My app is used serverside, and has no gui. (Jpegs are read and written to the file system). My question has to do with the use of MediaTracker to determine loading status. I am not totally clear on when I need a MediaTracker. I am using FileStreams to read in the source image like this:
FileInputStream in = new FileInputStream(_srcImgPath);
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);
bImage = decoder.decodeAsBufferedImage();
in.close();
After reading the file in, I perform AffineTransforms on the BufferedImage and then write the file back to disk.
Do I need to monitor image loading in this case? (or is it only when displaying the graphic, or when using Toolkit.getImage, or???) Would I be better off using Toolkit.getImage and then creating a BufferedImage from the Image?
Sorry, but I'm pretty confused! (my Class works btw, I'm just wondering if I should do things diff'tly)
thanks,
-ted
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ted,
Please see this link and make sure that you are following JavaRanch's official naming policy. Thanks,
Bodie
reply
    Bookmark Topic Watch Topic
  • New Topic