The Wave effect distorts the image as if it had been disturbed by a number of random waves.

By choosing appropriate values you can make images look like they are underwater or are being seen through a heat haze.

Syntax

[C#]

static void Wave(Bitmap bitmap, int number, double lengthMin, double lengthMax, double heightMin, double heightMax, Nullable<double> speed);

[Visual Basic]

Shared Sub Wave(bitmap As Bitmap, number As Integer, lengthMin As Double, lengthMax As Double, heightMin As Double, heightMax As Double, speed As Nullable(Of Double))
Params
Name Description
bitmap The bitmap to process
number The number of random waves that should be generated. A typical value might be 3.
lengthMin The minimum wavelength for a random wave. A typical value might be 40 pixels.
lengthMax The maximum wavelength for a random wave. A typical value might be 60 pixels.
heightMin The minimum amplitude for a random wave. A typical value might be 5 pixels.
heightMax The maximum amplitude for a random wave. A typical value might be 15 pixels.
speed There is a general speed versus quality tradeoff. Higher values produce faster results at the expense of quality. If null is provided this defaults to 6.
Notes

None.

Example

[C#]

using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/laurentiu-iordache-qstGMhWuORE-unsplash.jpg"))) {
  Effects.Wave(bm, 3, 40, 60, 5, 15, null);
  bm.Save(Server.MapPath("IG8_Effects_Wave1.jpg"));
}
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/laurentiu-iordache-qstGMhWuORE-unsplash.jpg"))) {
  Effects.Wave(bm, 3, 15, 30, 5, 15, null);
  bm.Save(Server.MapPath("IG8_Effects_Wave2.jpg"));
}
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/laurentiu-iordache-qstGMhWuORE-unsplash.jpg"))) {
  Effects.Wave(bm, 3, 40, 60, 0, 5, null);
  bm.Save(Server.MapPath("IG8_Effects_Wave3.jpg"));
}


The following example shows the basic effect of the Wave effect and how the parameters can change the effect produced. Ouput files are shown below.


laurentiu-iordache-qstGMhWuORE-unsplash.jpg


IG8_Effects_Wave1.jpg


IG8_Effects_Wave2.jpg


IG8_Effects_Wave3.jpg