Re: [JAVA2D] Convert Image object to Raster object

2000-02-01 Thread Darren Houle
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

Re: [JAVA2D] Convert Image object to Raster object

2000-02-01 Thread Darren Houle
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

Re: [JAVA2D] Convert Image object to Raster object

2000-02-01 Thread Eric Dofonsou
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

[JAVA2D] Paint invoked 3 times

2000-02-01 Thread R.M.Everson
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

Re: [JAVA2D] Convert Image object to Raster object

2000-02-01 Thread James C. Clover
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,

Re: [JAVA2D] Paint invoked 3 times

2000-02-01 Thread Jenkins, Andrew B
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

Re: [JAVA2D] Convert Image object to Raster object

2000-02-01 Thread Darren Houle
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

Re: [JAVA2D] Convert Image object to Raster object

2000-02-01 Thread Jim Graham
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