Click here to Skip to main content
Licence 
First Posted 29 Aug 2002
Views 128,417
Bookmarked 64 times

A C# water effect picture control

By | 29 Aug 2002 | Article
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:

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

About the Author

Christian Tratz

Web Developer

Germany Germany

Member

If you are not living on the edge you are wasting space Wink | ;)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionLicense PinmemberDanieBeckett23:37 19 Sep '11  
GeneralNeed Help PinmemberJames Noah Black20:09 17 Sep '11  
GeneralThis water effect control PinmemberJohn Chaffins7:05 17 Dec '09  
GeneralF U C K I N G C O O L!!! Pinmembericcb101320:10 16 Jul '09  
Generalhi i want to draw an drawing like a rug PinmembercuteAisha21:45 29 Aug '07  
Generalrunning slow Pinmemberstjds12:57 7 Jan '07  
GeneralBetter result PinmemberSaied Javadi3:58 8 Jul '06  
Hi,
Thanks for your goold control.
When i compare the results of your Water Effect with another on in http://www.durius.com/104.asp
i can see the better simulation in second program. one of differences is when i clicked on sample picture
it start with big wave instead small wave.
Thansk again.
QuestionWhy not a PictureBox? Pinmemberjeffreylreed5:49 19 May '04  
AnswerRe: Why not a PictureBox? PinmemberChristian Tratz6:51 19 May '04  
GeneralFix for the bug mentioned below PinmemberMatthew Watosn0:15 22 Apr '04  
GeneralBug PinmemberRawSteel6:49 14 Apr '04  
GeneralBug PinmemberSefai1:25 14 Aug '03  
GeneralRe: Bug Pinmemberaguisoft__17:45 21 Mar '10  
GeneralLove it! PinmemberStoo 7023:38 30 Jun '03  
GeneralNice Job but could not use it... Pinmemberjvalenz21:15 5 Mar '03  
GeneralRe: Nice Job but could not use it... PinmemberChristian Tratz23:26 5 Mar '03  
GeneralRe: Nice Job but could not use it... Pinmemberjvalenz9:32 6 Mar '03  
GeneralRe: Nice Job but could not use it... PinmemberChristian Tratz21:46 6 Mar '03  
GeneralRe: Nice Job but could not use it... Pinmemberjvalenz5:48 7 Mar '03  
AnswerRe: Nice Job but could not use it... PinmemberGiordani Ramos1:00 12 Dec '10  
GeneralWhy MouseMove and not MouseDown Pinmemberpatil5:29 7 Jan '03  
GeneralRe: Why MouseMove and not MouseDown PinmemberChristian Tratz6:54 7 Jan '03  
GeneralTranslation PinmemberHugo Hallman21:31 20 Oct '02  
GeneralRe: Translation PinmemberChristian Tratz21:55 20 Oct '02  
GeneralExcellent but want to change picture of control PinsussAnonymous20:26 17 Sep '02  

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

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120529.1 | Last Updated 30 Aug 2002
Article Copyright 2002 by Christian Tratz
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid