Package com.iizix.image
Class RoundedCorners
java.lang.Object
com.iizix.image.RoundedCorners
Class to round corner of an image.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic BufferedImageround(BufferedImage image, int radiusPercent) Performs a "soft-rounded clip" of the image file.static voidPerforms a "soft-rounded clip" of the image file.
Constructor Details
RoundedCorners
public RoundedCorners()
Method Details
round
public static void round(File input, File output, String formatName, int radiusPercent) throws IOException Performs a "soft-rounded clip" of the image file. The edges might overflow a little bit in the rounded area due to anti-aliasing.- Parameters:
input- The input image file.output- The output file where the rounded corners are applies.formatName- AStringcontaining the informal name of the format.radiusPercent- The radius percent to apply to the image file.- Throws:
IOException- For I/O errors.
round
Performs a "soft-rounded clip" of the image file. The edges might overflow a little bit in the rounded area due to anti-aliasing.- Parameters:
image- Input image.radiusPercent- The rounded corner value in the maximum size of the image, max(width,height).- Returns:
- The new rounded anti-aliased image.
- Throws:
IllegalArgumentException- IfradiusPercentis less than zero or larger than 100.