posted 23 years ago
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