Click here to Skip to main content
15,887,683 members
Articles / Programming Languages / C#
Article

A C# water effect picture control

Rate me:
Please Sign up or sign in to vote.
4.83/5 (24 votes)
29 Aug 2002 192.1K   6.4K   79   38
A C# implementation of the popular water surface effect.

Cool eh ?

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:

C#
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!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Germany Germany
If you are not living on the edge you are wasting space Wink | ;)

Comments and Discussions

 
AnswerRe: Nice Job but could not use it... Pin
Giordani Ramos12-Dec-10 1:00
professionalGiordani Ramos12-Dec-10 1:00 
GeneralWhy MouseMove and not MouseDown Pin
patil7-Jan-03 5:29
patil7-Jan-03 5:29 
GeneralRe: Why MouseMove and not MouseDown Pin
Christian Tratz7-Jan-03 6:54
Christian Tratz7-Jan-03 6:54 
GeneralTranslation Pin
Hugo Hallman20-Oct-02 21:31
Hugo Hallman20-Oct-02 21:31 
GeneralRe: Translation Pin
Christian Tratz20-Oct-02 21:55
Christian Tratz20-Oct-02 21:55 
GeneralExcellent but want to change picture of control Pin
Anonymous17-Sep-02 20:26
Anonymous17-Sep-02 20:26 
GeneralRe: Excellent but want to change picture of control Pin
Christian Tratz17-Sep-02 23:25
Christian Tratz17-Sep-02 23:25 
GeneralRe: Excellent but want to change picture of control Pin
HaflBit21-Mar-10 17:42
HaflBit21-Mar-10 17:42 
//this.waterControl.ImageBitmap = ((System.Drawing.Bitmap)(resources.GetObject("waterControl.ImageBitmap")));
-------->>>>
this.waterControl.ImageBitmap = new Bitmap("..\\..\\logo1.bmp");
GeneralNice Pin
Nnamdi Onyeyiri30-Aug-02 4:30
Nnamdi Onyeyiri30-Aug-02 4:30 
GeneralRe: Nice Pin
zjwuweim2-Sep-02 15:13
zjwuweim2-Sep-02 15:13 
GeneralCool Job Christian Pin
2sky30-Aug-02 3:49
2sky30-Aug-02 3:49 
GeneralRe: Cool Job Christian Pin
Christian Tratz30-Aug-02 4:23
Christian Tratz30-Aug-02 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.