Linear Motion Blur

 

The FilterMotionBlur function/method of the BiFilter DLL/OCX can be used to generate motion blur noise on an image.

 

[C++]

 

/* Adding motion blur to an image */

 

#include “BiFilter.h”

#include “BiImage.h”

 

HDIB hDibNew;

 

/* 1. parameter: Handle of the DIB to filter

   2. parameter: Angle

   3. parameter: Distance

   4. parameter: Show progress

   5. parameter: Handle of parent window */

 

hDibNew = FilterMotionBlur(hDib, 0, 20, DISPLAY_BOTH,

AfxGetMainWnd()->m_hWnd);

 

if (!hDibNew)

{

            // Error

}

 

[C#]

 

/* Adding motion blur to an image */

 

long hDibNew;

 

/* 1. parameter: Handle of the DIB to filter

   2. parameter: Angle

   3. parameter: Distance

   4. parameter: Show progress

   5. parameter: Handle of parent window */

 

hDibNew = BiFilter.FilterMotionBlur(hDib, 0, 20, Convert.ToInt16(BIFILTERLib.enumDisplayModes.DispBoth),

Handle.ToInt32());

 

if (hDibNew == 0)

{

            // Error

}