Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to create a WaveImageFilter .

Posted on 2001-06-15
5
Medium Priority
?
227 Views
Last Modified: 2010-03-31
Somebody know how to implements undersurface shadow effect like follow link show ,

http://ns.strategicstaff.lt/~monarch/java/edu/ImageEffect/test.html

thanks.
0
Comment
Question by:bruce_luo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:Sasha_Mapa
ID: 6195598
I have written my own version of the lake effect, I've just put the source code for download from http://www.hightemplar.com/sasha/lakeeffect.zip

Sasha Maryanovsky.
0
 

Author Comment

by:bruce_luo
ID: 6197300
public class LakeTest extends Applet
{
     /**
      * This method is called when the applet is created.
      */
     private LakeComponent wave = null ;
     private Image img = null ;
     
     public void init()
     {
         
          MediaTracker mt = new MediaTracker(this) ;
          try {
               img = this.getImage(this.getCodeBase(), "java.gif") ;
               mt.addImage(img, 0) ;
               mt.waitForID(0) ;
          }
          catch (Exception e) {
               e.printStackTrace() ;
          }
         
          int w = img.getWidth(this) ;
          int h = img.getHeight(this) ;
         
         
          wave = new LakeComponent(img) ;
          this.setLayout(null) ;
          this.add(wave) ;
          wave.setBounds(w + 20, 0, w, h) ;
          wave.createAnimation() ;
          wave.startAnimation() ;
     }
     
     public void paint(Graphics g)
     {
          g.drawImage(img, 0, 0, this) ;
     }
     
     public void update(Graphics g)
     {
          paint(g) ;
     }    
}

    The wave Object isn't work, the object always display a same picture at Applet . Some parameter need config ? Something wrong ?

regards,
Bruce
0
 

Author Comment

by:bruce_luo
ID: 6197306
public class LakeTest extends Applet
{
     /**
      * This method is called when the applet is created.
      */
     private LakeComponent wave = null ;
     private Image img = null ;
     
     public void init()
     {
         
          MediaTracker mt = new MediaTracker(this) ;
          try {
               img = this.getImage(this.getCodeBase(), "java.gif") ;
               mt.addImage(img, 0) ;
               mt.waitForID(0) ;
          }
          catch (Exception e) {
               e.printStackTrace() ;
          }
         
          int w = img.getWidth(this) ;
          int h = img.getHeight(this) ;
         
         
          wave = new LakeComponent(img) ;
          this.setLayout(null) ;
          this.add(wave) ;
          wave.setBounds(w + 20, 0, w, h) ;
          wave.createAnimation() ;
          wave.startAnimation() ;
     }
     
     public void paint(Graphics g)
     {
          g.drawImage(img, 0, 0, this) ;
     }
     
     public void update(Graphics g)
     {
          paint(g) ;
     }    
}

    The wave Object isn't work, the object always display a same picture at Applet . Some parameter need config ? Something wrong ?

regards,
Bruce
0
 
LVL 7

Accepted Solution

by:
Sasha_Mapa earned 400 total points
ID: 6197722
LakeComponent displays a vertical reflection of the image, so you need to make it twice taller than the image, not the same height.

Sasha Maryanovsky.
0
 

Author Comment

by:bruce_luo
ID: 6200647
perfect source. thanks,

Bruce
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question