| java.lang.Object com.blogofbug.utility.ImageUtilities
ImageUtilities | public class ImageUtilities (Code) | | Static class with utility methods for images
author: nigel |
Method Summary | |
public static BufferedImage | copyImage(BufferedImage image) | public static BufferedImage | createCompatibleImage(int width, int height) | public static BufferedImage | loadCompatibleImage(String imageURL) | public static BufferedImage | loadCompatibleImageResource(Class from, String resource) | public static BufferedImage | renderComponentToImage(JComponent component) Renders a component into an image, which is useful for playing with the component's
resultant image in special effects or transitions
Parameters: component - The component to render A buffered image with the rendered component. | public static BufferedImage | renderTextToImage(Font font, Color textColor, String text, int width) Renders a paragraph of text (line breaks ignored) to an image (created and returned). | public static BufferedImage | renderTextToImage(Font font, Color textColor, String text, int width) Renders multiple paragraphs of text in an array to an image (created and returned). | public static BufferedImage | scaledImage(BufferedImage image, int width, int height) |
copyImage | public static BufferedImage copyImage(BufferedImage image)(Code) | | Produces a copy of the supplied image
Parameters: image - The original image The new BufferedImage |
createCompatibleImage | public static BufferedImage createCompatibleImage(int width, int height)(Code) | | Creates an image compatible with the current display
A BufferedImage with the appropriate color model |
loadCompatibleImage | public static BufferedImage loadCompatibleImage(String imageURL)(Code) | | Loads an image in a format compatible with the current display
A BufferedImage with the appropriate color model |
renderComponentToImage | public static BufferedImage renderComponentToImage(JComponent component)(Code) | | Renders a component into an image, which is useful for playing with the component's
resultant image in special effects or transitions
Parameters: component - The component to render A buffered image with the rendered component. |
renderTextToImage | public static BufferedImage renderTextToImage(Font font, Color textColor, String text, int width)(Code) | | Renders a paragraph of text (line breaks ignored) to an image (created and returned).
Parameters: font - The font to use Parameters: textColor - The color of the text Parameters: text - The message Parameters: width - The width the text should be limited to An image with the text rendered into it |
renderTextToImage | public static BufferedImage renderTextToImage(Font font, Color textColor, String text, int width)(Code) | | Renders multiple paragraphs of text in an array to an image (created and returned).
Parameters: font - The font to use Parameters: textColor - The color of the text Parameters: text - The message in an array of strings (one paragraph in each Parameters: width - The width the text should be limited to An image with the text rendered into it |
scaledImage | public static BufferedImage scaledImage(BufferedImage image, int width, int height)(Code) | | Produces a resized image that is of the given dimensions
Parameters: image - The original image Parameters: width - The desired width Parameters: height - The desired height The new BufferedImage |
|
|