File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes mediatracker and streams Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "mediatracker and streams" Watch "mediatracker and streams" New topic
Author

mediatracker and streams

lint
Greenhorn

Joined: Jan 22, 2000
Posts: 2
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

Joined: Nov 22, 2008
Posts: 18944
Ted,
Please see this link and make sure that you are following JavaRanch's official naming policy. Thanks,
Bodie
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: mediatracker and streams
 
Similar Threads
Save BufferedImage
Image smoothing
Opening .gif files
Get image size
Image not getting painted.