[3273] in java-interest
Re: ImageProducer/Consumer classes
daemon@ATHENA.MIT.EDU (David Gourley)
Sun Nov 5 19:36:07 1995
From: David Gourley <dgourley@CS.Berkeley.EDU>
To: flar@bendenweyr.eng.sun.com (Jim Graham)
cc: java-interest@java.sun.com
In-reply-to: Your message of "Fri, 03 Nov 1995 17:39:27 PST."
<9511040139.AA26131@bendenweyr.Eng.Sun.COM>
Date: Sun, 05 Nov 1995 14:48:16 -0800
Hello again...
> > I understand that I can implement the producer interface which can go off
> > and get the frames and then call the appropriate method in the consumer
> > class notifying that a frame has arrived and is ready, the part I am not
> > sure about is that once a frame has arrived the consumer must either notify
> > or arrange for it to be displayed. Should it create an Image for each frame
> > and then display? This seems inefficient, there must be a cleaner way to do
> > this, but I just dont see it. Any help would be appreciated.
>
> When you create an image from an ImageProducer using
>
> Component.createImage(ImageProducer)
>
> you get back a handle to something that will take care of managing the
> ImageConsumers needed to get the bits to the screen on its own. These
> ImageConsumers will also take care of notifying applets that are drawing
> the image that a new frame is available using the ImageObserver notification
> mechanism.
>
You get back an Image Object from the above call, I am unclear on how you
can go about using an ImageProducer to set the pixels of this Image. The
ImageConsumer interface has a call to explicitly set the pixel vals and
convert them with a given color model, but as I dont see how to get a
reference to the ImageConsumer for this Image I am at a loss. Any help
would be appreciated.
> So, all you have to worry about is writing the ImageProducer and then
> creating one image for it using the above method and from then on that
> one image will be the way to draw each successive frame.
>
> ...jim
Thanks.
-david
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com