There is an ImageObserver parameter on the drawImage calls, but it can be null.
Jim, that's the first thing I tried when I started this project. If that's so then
why doesn't this work...
import java.io.*;
import java.awt.*;
import java.awt.image.*;
import com.sun.image.codec.jpeg.*;
public
The java.awt.MediaTracker object can help you to make sure that the image is
completely loaded before you do the conversion so that the ImageObserver is then
essentially irrelevant.
Also, the MediaTracker object requires a Componant object to be passed to it and I'm
running a console
Sorry for stepping in on your conversation...
As far as I can remember, the MediaTracker can take a NULL component if
not you can always build a usless component and pass it there, I think
this works too :-). The component parameter is only require so the Media
can informe the component that
Hello,
Can anyone shed any light on this, please?
I'm puzzled why the paint method is invoked 3 times when a frame is
first displayed. For small applications this isn't a problem, but if
the paint method is complicated it results in annoying flickering.
To see a demo compile the following
g.drawImage(scaled_image, null, null);
Here's your problem. I'm not sure why you're trying to use a null kernel op
(getting all black pixels from a null kernel op actually sounds correct to
me), but try using a different paint method from Graphics:
boolean drawImage(Image img,
Richard,
The exact instances when paint() gets called is
very dependent on the JVM implementation. For
example, (commenting out Java2D stuff), running
your example on JDK 1.1.7 produces 2 paints at
startup, and 2 on each resize. On 1.2.2 with HotSpot,
there is one at startup, and 1 with each
Actually, I discovered a more elegant way to accomplish what I've been trying to do,
which is open a JPG, resize it, and save it out as a JPG
import java.io.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import
Hi Darren,
(Even though you found a more direct way of solving your problem, I
wanted to respond to some of the points and questions made in this
thread...)
first, the application hangs at the DOS prompt and never completes
although the final println _does_ happen.
Whenever you use the AWT