A C# water effect picture control






4.83/5 (22 votes)
Aug 30, 2002

197741

6440
A C# implementation of the popular water surface effect.
Intro
This control is a C# implementation of the well known water effect. There are already two implementations of this algorithm on CodeProject: Really cool visual FX - a C++ variant - and a OpenGL Interactive water effect.
The algorithm itself is well described here and here.
How to use it
The control itself is derived from System.Windows.Forms.Panel
. So all you have to do is to place a standard
PictureBox
control onto your form and change the type of this control to WaterEffectControl
.
Then adjust the image source property as follows:
waterControl.ImageBitmap = ((System.Drawing.Bitmap)
(resources.GetObject("waterControl.ImageBitmap")));
Now run the program, and move the mouse over the image while the left button is pressed. The effect is clearly better than the picture above shows.
Enjoy!