PROBLEM:
I have created an application that will blur an image and display it in a 
JPanel.  I have also created something I call a Spotlight.  Basically, it 
tracks the mouse, and displays a circular region on the blurred image that 
actually draws the image unblured.  I implemented this effect by overriding the 
paintComponent method thusly:

        protected void paintSpotlight(Graphics g)
        {
                Area clipRegion = new Area( getSpotlight().getArea() );

                Graphics2D g2 = ( Graphics2D ) g;
                int width = getWidth();
                int height = getHeight();

                if( getBlurredImage() != null )
                {
                        width = getBlurredImage().getWidth()
                        height = getBlurredImage().getHeight();
                }
                g2.drawImage( getBlurredImage(), 0, 0, width, height, null );
                g2.setClip( clipRegion );
                g2.drawImage( getUnblurredImage(), 0, 0, width, height, null );
        }

This all works well.

What I'd like to do now is have multiple Spotlights.  In other words, I'd like 
to have kind of a "swiss cheese" effect, where I have the blurred image with 
little sections of unblurred image showing in various places.

I've tried looping through the Spotlights and setting the adding to the clip 
region for each time, but that didn't work.  It drew the entire image unblurred.

Any suggestions or pointers would be appreciated.

Thanks,

Steve
[Message sent by forum member 'stenew' (stenew)]

http://forums.java.net/jive/thread.jspa?messageID=206760

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to