Class ScreenImage


  • public class ScreenImage
    extends Object
    CANDIDATE FOR DEPRECATION stores a BufferedImage usually ceated by screen capture, the screen rectangle it was taken from and the filename, where it is stored as PNG (only if requested) This will be replaced by Image in the long run
    • Field Detail

      • x

        public int x
        x, y, w, h of the stored ROI
      • y

        public int y
        x, y, w, h of the stored ROI
      • w

        public int w
        x, y, w, h of the stored ROI
      • h

        public int h
        x, y, w, h of the stored ROI
      • _filename

        protected String _filename
    • Constructor Detail

      • ScreenImage

        public ScreenImage​(Rectangle roi,
                           BufferedImage img)
        create ScreenImage with given
        Parameters:
        roi - the rectangle it was taken from
        img - the BufferedImage
    • Method Detail

      • getFilename

        @Deprecated
        public String getFilename()
                           throws IOException
        Deprecated.
        use getFile() instead
        creates the PNG tempfile only when needed.
        Returns:
        absolute path to stored tempfile
        Throws:
        IOException - if not found
      • getFile

        public String getFile()
        INTERNAL USE: use getTimedFile() instead
        Returns:
        absolute path to stored file
      • getStoredAt

        public String getStoredAt()
      • save

        public String save()
        stores the image as PNG file in the standard temp folder with a created filename (sikuliximage-timestamp.png) if not yet stored before
        Returns:
        absolute path to stored file
      • getFile

        public String getFile​(String path)
        stores the image as PNG file in the given path with a created filename (sikuliximage-timestamp.png)
        Parameters:
        path - valid path string
        Returns:
        absolute path to stored file
      • save

        public String save​(String path)
        stores the image as PNG file in the given path with a created filename (sikuliximage-timestamp.png)
        Parameters:
        path - valid path string
        Returns:
        absolute path to stored file
      • save

        public String save​(String path,
                           String name)
        stores the image as PNG file in the given path with a created filename (givenName-timestamp.png)
        Parameters:
        path - valid path string
        name - file name
        Returns:
        absolute path to stored file
      • getFile

        public String getFile​(String path,
                              String name)
        stores the image as PNG file in the given path with the given filename
        Parameters:
        path - valid path string
        name - filename (.png is added if not present)
        Returns:
        absolute path to stored file
      • saveInBundle

        public String saveInBundle​(String name)
      • getImage

        public BufferedImage getImage()
        Returns:
        the stored image in memory
      • getRegion

        public Region getRegion()
        Returns:
        the Region, the iamge was created from
      • getROI

        public Rectangle getROI()
        Returns:
        the screen rectangle, the iamge was created from
      • saveLastScreenImage

        public void saveLastScreenImage​(File fPath)