Package ca.corbett.extras.image
Class LogoGenerator
java.lang.Object
ca.corbett.extras.image.LogoGenerator
Utility class to generate small, text-based images that can serve as a
very quick logo type of thing. This was moved into sc-util from the
standalone LogoGenerator app as it makes more sense to live here.
- Author:
- scorbo2
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidgenerateAndSaveImage(String text, LogoProperty preset, File outputFile) Generates an image using the given text and LogoConfig instance, and then saves it to the given File.static BufferedImagegenerateImage(String text, LogoProperty preset) Generates an image using the given text and LogoConfig instance.
-
Method Details
-
generateImage
Generates an image using the given text and LogoConfig instance.- Parameters:
text- The text to render.preset- The LogoConfig instance containing config settings to use.- Returns:
- A BufferedImage containing the rendered final product.
-
generateAndSaveImage
public static void generateAndSaveImage(String text, LogoProperty preset, File outputFile) throws IOException Generates an image using the given text and LogoConfig instance, and then saves it to the given File. Output format is currently limited to jpeg regardless of what file name/extension you pass in here.- Parameters:
text- The text to render.preset- The LogoConfig instance containing config settings to use.outputFile- The file to which the image will be saved. Must be writable.- Throws:
IOException- if something goes wrong.
-