ImageEn, unit imageenproc




procedure FeatherAlphaEdges(iFeatherDepth : Integer);


Applies a feathering effect to the image. Feathering softens the edges of an image by applying alpha transparency at a rate that is proportional to the distance to the edge (specifically, adding a gradient in the alpha channel).

iFeatherDepth specifies the depth in pixels of the feather effect. The range is 0 to 255, with typical values of 2 to 5. If iFeatherDepth = 0 then the image is not feathered but a simple smoothing filter is applied to reduce the jagged edges of the image.

Note: Method has no effect if the image does not have an alpha channel


// Feather edges of a transparent GIF
ImageEnView1.IO.LoadFromFile( 'D:\image.gif' );

// Feather the border of a JPEG image
ImageEnView1.IO.LoadFromFile( 'D:\image.jpg' );
ImageEnView1.IEBitmap.AlphaChannel; // Add alpha channel to image
ImageEnView1.IEBitmap.Resize(1, 1, 1, 1, clWhite, 0); // Add an alpha border