GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / FxGaussian Method
GdPicture image identifier.
The size of the square kernel to use. Should be a odd value. For example, a size of 3 will involve 3 * 3 pixels in each pass. The larger the value the more blur you get. The range is larger or equal than 3, and less than the Image's Smaller Dimension (Width, Height) divided by 2. Suggested value is 3 for a [96-120] DPI image and 5 for a [200-250] dpi bitmap. If the value supplied is our of range the method will return GdPictureStatus.InvalidParameter.
Example





In This Topic
FxGaussian Method (GdPictureImaging)
In This Topic
Performs a Gaussian (blur via Gaussian deviation formula)filter of any size of kernel (amount of pixels included in operation) on a GdPicture image or on an area of a GdPicture image defined by SetROI() method.
Syntax
'Declaration
 
Public Function FxGaussian( _
   ByVal ImageID As Integer, _
   ByVal KernelSize As Integer _
) As GdPictureStatus
public GdPictureStatus FxGaussian( 
   int ImageID,
   int KernelSize
)
public function FxGaussian( 
    ImageID: Integer;
    KernelSize: Integer
): GdPictureStatus; 
public function FxGaussian( 
   ImageID : int,
   KernelSize : int
) : GdPictureStatus;
public: GdPictureStatus FxGaussian( 
   int ImageID,
   int KernelSize
) 
public:
GdPictureStatus FxGaussian( 
   int ImageID,
   int KernelSize
) 

Parameters

ImageID
GdPicture image identifier.
KernelSize
The size of the square kernel to use. Should be a odd value. For example, a size of 3 will involve 3 * 3 pixels in each pass. The larger the value the more blur you get. The range is larger or equal than 3, and less than the Image's Smaller Dimension (Width, Height) divided by 2. Suggested value is 3 for a [96-120] DPI image and 5 for a [200-250] dpi bitmap. If the value supplied is our of range the method will return GdPictureStatus.InvalidParameter.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method is used in the "Image Processing" and the "Document Clean Up" C# Demo.
Example
Applies a gaussian filter to a region of interest set on an image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // LoadInMemory parameter is set to true in order to be able to update the input file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image_1080x720.jpg", true);
 
    // Set the blur intensity of the gaussian filter.
    int kernel = 20;
 
    // Set the region of interest.
    gdpictureImaging.SetROI(300, 200, 500, 150);
    // Apply the gaussian filter to the ROI.
    gdpictureImaging.FxGaussian(imageID, kernel);
    // Delete the region of interest.
    gdpictureImaging.ResetROI();
    gdpictureImaging.SaveAsJPEG(imageID, "image_1080x720.jpg");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also