Hi all,
Thanks Joe for the first ideas. It looks already a lot better without the
flickering, but my major performance problem is not yet solved. I have
modified the example to behave exactly as it should. The dragged image
should be partly transparent, which decreases the performance a lot. It
tried it out with a regular image (using createImage on the JPanel) and this
results in almost acceptable dragging performance. As soon as I start using
a transparent image, the performance with bigger images is unacceptable. We
face the challenge to drag the complete screen content to another location,
full screen.
I can imagine that someone has already faced the same problem, and there
might be a solution.
Thanks,
Wim
<<ImageDragger.java>>
> -----Original Message-----
> From: Joe Sam Shirah [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, June 03, 1999 08:30
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [java2d] Dragging transparent images
>
> Hi Wim,
>
> A) Swing is huge and takes OO to an extreme, complete with lack of
> object reuse. Java 2D has not really been optimized at this point.
>
> B) Larger images are naturally slower. When dragging larger
> images, in any graphics environment, one needs to start thinking of
> animation techniques, like tracking smaller 'dirty' areas.
>
> Having said that, when one sees flashing, as was occurring in your
> program, one should think of double buffering. And that was the
> problem. Swing components default to double buffering and I rewrote
> your code to take advantage of it (see attached. ) If you used regular
> or lightwight AWT code, you would need to implement double
> buffering yourself. Hope this gives you some ideas for your needs.
>
>
> Joe Sam Shirah
> Autumn Software
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Wednesday, June 02, 1999 10:55 AM
> Subject: [java2d] Dragging transparent images
>
>
> >I am working on an application where we need to drag transparent images
> over
> >a JPanel. Using jdk1.2.2 Early Access I cannot get the desired
> performance
> >out of my program. Can anyone have a look at the attached code, I can
> only
> >hope I am doing something wrong and there is a better and faster way of
> >doing all this.
> >
> >Thanks,
> >
> >Wim
> >
> << File: ImageDragger.java >>
ImageDragger.java