Motion Blur from Center

 

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

 

[C++]

 

/* Adding motion blur from the center of an image */

 

#include “BiFilter.h”

#include “BiImage.h”

 

HDIB hDibNew;

 

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

   2. parameter: Factor of blur

   3. parameter: Distance

   4. parameter: Show progress

   5. parameter: Handle of parent window */

 

hDibNew = FilterCenterMotionBlur(hDib, 20, 5, DISPLAY_BOTH,

AfxGetMainWnd()->m_hWnd);

 

if (!hDibNew)

{

            // Error

}

 

[VB]

 

‘ Adding motion blur from the center of an image

 

Dim BIFilterObj as Object

Dim hDibNew as Long

 

Set BIFilterObj = CreateObject("BIFILTER.BIFilterCtrl.1")

 

‘ 1. parameter: Handle of the DIB to filter

‘ 2. parameter: Factor of Blur

‘ 3. parameter: Distance

‘ 4. parameter: Show progress

‘ 5. parameter: Handle of parent window

 

hDibNew = BIFilterObj.FilterCenterMotionBlur(hDib, 20, 5,_

DispBoth, hWnd)

 

Set BIFilterObj = Nothing

 

If hDibNew = 0 Then

            ‘ Error

End If

 

[C#]

 

/* Adding motion blur from the center of an image */

 

int hDibNew;

 

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

   2. parameter: Factor of Blur

   3. parameter: Distance

   4. parameter: Show progress

   5. parameter: Handle of parent window */

 

hDibNew = BiFilter.FilterCenterMotionBlur(hDib, 20, 5, Convert.ToInt16(BIFILTERLib.enumDisplayModes.DispBoth),

Handle.ToInt32());

 

if (hDibNew == 0)

{

            // Error

}