Class SignatureImage

All Implemented Interfaces:
Serializable, Comparable<Object>, IDBean, Cacheable

public class SignatureImage extends DatabaseBlobBean
A bean to store Signature Images for processing.
Since:
2.3
Version:
7.0
Author:
Luke
See Also:
  • Constructor Details

    • SignatureImage

      public SignatureImage(int id)
      Initializes the bean.
      Parameters:
      id - the Pilot's database ID
      Throws:
      IllegalArgumentException - if id is zero or negative
  • Method Details

    • getHeight

      public int getHeight()
      Returns the image height.
      Returns:
      the height in pixels, or -1 if not loaded
    • getWidth

      public int getWidth()
      Returns the image width.
      Returns:
      the width in pixels, or -1 if not loaded
    • load

      public void load(byte[] buffer)
      Loads the image from a byte array and updates the internal buffer.
      Overrides:
      load in class DatabaseBlobBean
      Parameters:
      buffer - the image buffer
      Throws:
      IllegalArgumentException - if the image cannot be parsed
      See Also:
    • load

      public void load(InputStream is) throws IOException
      Loads the image from a stream.
      Overrides:
      load in class DatabaseBlobBean
      Parameters:
      is - the stream containing the data
      Throws:
      IOException - if an error occurs reading the stream data
      See Also:
    • watermark

      public void watermark(String txt, int tx, int ty)
      Marks the signature with a watermark.
      Parameters:
      txt - the watermark text
      tx - the x-coordinate of the text
      ty - the y-coordinate of the text
    • getImage

      public byte[] getImage(String fmt) throws IOException
      Retrieves the new image in a particular format.
      Parameters:
      fmt - the format code (eg. gif, jpg, png)
      Returns:
      the formatted image
      Throws:
      IOException - if an error occurs