[4508] in java-interest
Re: Clipping Rectangles
daemon@ATHENA.MIT.EDU (Pat Niemeyer)
Wed Jan 3 20:11:27 1996
Date: Wed, 3 Jan 1996 17:43:13 -0600 (CST)
From: Pat Niemeyer <pat@icon-stl.net>
To: Elliotte Rusty Harold <elliotte@blackstar.com>
cc: java-interest@java.sun.com
In-Reply-To: <753795D1E4B@blackstar.blackstar.com>
On Wed, 3 Jan 1996, Elliotte Rusty Harold wrote:
> A couple of weeks ago I asked how one might reset the clipping
> rectangles. I haven't received any responses though I''ve seen
> several other people with similar problems. Recently, however, I
> figured out a solution.
>
> Ignore Graphics.clipRect completely. It's severely flawed. Instead
> create separate offscreen Images for each clipping region. Draw into
> those offScreen Images and then copy them onto the appropriate
> section of the of your applet window. Some coordinate conversion will
> almost certainly be necessary.
Hey Rusty,
You can't reset a clipping region, but you can get a new graphics context
whenever you want want with getGraphics(). In fact, it seems to be
faster to create a new graphics context than to copy one with
Graphics.create().
You obviously need off screen drawing as well, but my experience has been
that clipping seriously speeds things up when used to clip drawing into
the off screen buffer and then again to clip the copy back to the display.
Could someone who knows something about the implementation comment on this?
Pat
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com