src/Foundation/Media/Gimela.Media.Imaging/Filters/BaseFilter.cs
/// <summary>
/// Apply filter to an image.
/// </summary>
/// 
/// <param name="image">Source image to apply filter to.</param>
/// 
/// <returns>Returns filter's result obtained by applying the filter to
/// the source image.</returns>
/// 
/// <remarks>The method keeps the source image unchanged and returns
/// the result of image processing filter as new image.</remarks>
/// 
/// <exception cref="UnsupportedImageFormatException">Unsupported pixel format of the source image.</exception>
///
Apply filter to an image.
Apply filter to an image .
public Bitmap Apply(Bitmap image)
    {
      BitmapData srcData = image.LockBits(
          new Rectangle(0, 0, image.Width, image.Height),
          ImageLockMode.ReadOnly, image.PixelFormat);
      Bitmap dstImage = null;
      try
      {
        dstImage = Apply(srcData);
      }
      finally
      {
        image.UnlockBits(srcData);
      }
      return dstImage;
    }
public Bitmap Apply ( Bitmap image ) { BitmapData srcData = image . LockBits ( new Rectangle ( 0 , 0 , image . Width , image . Height ) , ImageLockMode . ReadOnly , image . PixelFormat ) ; Bitmap dstImage = null ; try { dstImage = Apply ( srcData ) ; } finally { image . UnlockBits ( srcData ) ; } return dstImage ; }
Apply filter to an image.
Apply filter to an image .
// lock source bitmap data // apply the filter // unlock source image
Returns filter's result obtained by applying the filter to
the source image.
Returns filter ' s result obtained by applying the filter to the source image .
Unsupported pixel format of the source image.
Unsupported pixel format of the source image .
image
Bitmap
Source image to apply filter to.
Source image to apply filter to .
remarks
The method keeps the source image unchanged and returns
the result of image processing filter as new image.
The method keeps the source image unchanged and returns the result of image processing filter as new image .