public Image ProcessImage(ImageFactory factory)
{
Image image = factory.Image;
try
{
RoundedCornerLayer roundedCornerLayer = this.DynamicParameter;
int radius = roundedCornerLayer.Radius;
bool topLeft = roundedCornerLayer.TopLeft;
bool topRight = roundedCornerLayer.TopRight;
bool bottomLeft = roundedCornerLayer.BottomLeft;
bool bottomRight = roundedCornerLayer.BottomRight;
// Create a rounded image.
image = this.RoundCornerImage(image, radius, topLeft, topRight, bottomLeft, bottomRight);
return image;
}
catch (Exception ex)
{
throw new ImageProcessingException("Error processing image with " + this.GetType().Name, ex);
}
}