• Post Reply Bookmark Topic Watch Topic
  • New Topic

mediatracker and streams

 
lint
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ted,
Please see this link and make sure that you are following JavaRanch's official naming policy. Thanks,
Bodie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!