Function Reference


Creates a Blur class effect object

#include <GDIPlus.au3>
_GDIPlus_EffectCreateBlur ( [$fRadius = 10.0 [, $bExpandEdge = False]] )


$fRadius [optional] Real number that specifies the blur radius (the radius of the Gaussian convolution kernel) in pixels.
The radius must be in the range 0.0 through 255.0.
$bExpandEdge [optional] Boolean value that specifies whether the bitmap expands by an amount equal to the blur radius.
If TRUE, the bitmap expands by an amount equal to the radius so that it can have soft edges.
If FALSE, the bitmap remains the same size and the soft edges are clipped.

Return Value

Success: a handle to an Effect object.
Failure: 0 and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).
@error: -1 - GDIPlus.dll does not support this function.
10 - Invalid parameters.


When you are done with the Effect object, call _GDIPlus_EffectDispose() to release the resources.


_GDIPlus_EffectCreate, _GDIPlus_EffectDispose


#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>


Func _Example()
    If Not _GDIPlus_Startup() Or @extended < 6 Then
        MsgBox($MB_SYSTEMMODAL, "ERROR", "GDIPlus.dll v1.1 not available")

    Local $sFile = FileOpenDialog("Select an image", "", "Images (*.bmp;*.png;*.jpg;*.gif;*.tif)")
    If @error Or Not FileExists($sFile) Then Return

    Local $hImage = _GDIPlus_ImageLoadFromFile($sFile)

    Local $iWidth = 600
    Local $iHeight = _GDIPlus_ImageGetHeight($hImage) * 600 / _GDIPlus_ImageGetWidth($hImage)

    Local $hGui = GUICreate("GDI+ v1.1 (" & @ScriptName & ")", $iWidth, $iHeight)
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)

    Local $hEffect = _GDIPlus_EffectCreateBlur()
    _GDIPlus_BitmapApplyEffect($hImage, $hEffect)

    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $iWidth, $iHeight)

    Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc   ;==>_Example