The Pinch effect distorts the image as if it had been pinched.

The effect distorts the image as if it had been pinched.

Syntax

[C#]

static void Pinch(Bitmap bitmap, double amount, double extent, Nullable<double> speed);

[Visual Basic]

Shared Sub Pinch(bitmap As Bitmap, amount As Double, extent As Double, speed As Nullable(Of Double))
Params
Name Description
bitmap The bitmap to process
amount The amount that the image should be pinched. This value is a percentage. A typical value might be 50.
extent How far the effect should extend. This value is a percentage. A typical value might be 50.
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 3.
Notes

None.

Example

[C#]using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/vladimir-tsokalo-N3moZ3Gn-gI-unsplash.jpg"))) {
  Effects.Pinch(bm, 50, 50, 3);
  bm.Save(Server.MapPath("IG8_Effects_Pinch1.jpg"));
}
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/vladimir-tsokalo-N3moZ3Gn-gI-unsplash.jpg"))) {
  Effects.Pinch(bm, 75, 50, 3);
  bm.Save(Server.MapPath("IG8_Effects_Pinch2.jpg"));
}
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/vladimir-tsokalo-N3moZ3Gn-gI-unsplash.jpg"))) {
  Effects.Pinch(bm, 100, 50, 3);
  bm.Save(Server.MapPath("IG8_Effects_Pinch3.jpg"));
}


Here we apply a Pinch edge detection filter using different radii. Ouput files are shown below.


vladimir-tsokalo-N3moZ3Gn-gI-unsplash.jpg


IG8_Effects_Pinch1.jpg


IG8_Effects_Pinch2.jpg


IG8_Effects_Pinch3.jpg