FxGaussian Method (GdPictureImaging)
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.
'Declaration
Public Function FxGaussian( _
ByVal As Integer, _
ByVal As Integer _
) As GdPictureStatus
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.
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);
}