Image Filter art --- Wave filter, image filter --- wave

Source: Internet
Author: User

Image Filter art --- Wave filter, image filter --- wave
Wave Filter the water Filter simulates the effect of water waves by means of coordinate transformation, so that the image presents a special effect of water waves. This filter has an adjustable parameter: the distortion of water waves. The Code is as follows: // Wave Filter ///// Source image. /// The degree of wave, 0-100. /// The result image. private Bitmap WaveFilterProcess (Bitmap srcBitmap, int degree) {Bitmap a = new Bitmap (srcBitmap); int w =. width; int h =. height; degree = degree * 32/100; degree = Math. max (0, Math. min (32, degree); Bitmap dst = new Bitmap (w, h); System. drawing. imaging. bitmapData srcData =. lockBits (new Rectangle (0, 0, w, h), System. drawing. imaging. imageLockMode. readWrite, System. drawing. imaging. pixelFormat. format32bppArgb); System. drawing. imaging. bitmapData dstData = dst. lockBits (new Rectangle (0, 0, w, h), System. drawing. imaging. imageLockMode. readWrite, System. drawing. imaging. pixelFormat. format32bppArgb); unsafe {byte * pIn = (byte *) srcData. scan0.ToPointer (); byte * pOut = (byte *) dstData. scan0.ToPointer (); byte * p = null; int stride = srcData. stride-w * 4; int newX = 0, newY = 0; double PI2 = Math. PI * 2.0; for (int y = 0; y :

Source image

Water Filter

Finally put a complete C # version of the program Demo: http://www.zealpixel.com/thread-59-1-1.html

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.