Package com.storedobject.common
Class GeneratedImage
java.lang.Object
com.storedobject.common.GeneratedImage
-
Field Summary
Fields inherited from interface com.storedobject.common.ContentGenerator
ext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
generateContent
(Graphics graphics) Generate the image.final void
Generate the content and write to an output stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.common.ImageGenerator
getContentType, getFileExtension
-
Constructor Details
-
GeneratedImage
public GeneratedImage(int width, int height) Constructor.- Parameters:
width
- Width of the image.height
- Height of the image.
-
GeneratedImage
Constructor.- Parameters:
in
- The stream that supplies a base image.
-
-
Method Details
-
generateContent
Description copied from interface:ImageGenerator
Generate the content and write to an output stream.- Specified by:
generateContent
in interfaceImageGenerator
- Parameters:
out
- Output stream where the generated image will be written to.- Throws:
Exception
- if content can not be generated.
-
generateContent
Generate the image. The base image if already specified is already loaded on the graphics instance.Note: You may override this method to generate any image by drawing anything to it.
- Parameters:
graphics
- The graphics instance to which yuu can draw anything.
-