Class ScreenImage

java.lang.Object
org.sikuli.script.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 Details

  • Constructor Details

    • ScreenImage

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

    • setStartEnd

      public void setStartEnd​(Location start, Location end)
    • getStart

      public Location getStart()
    • getEnd

      public Location getEnd()
    • getSub

      public ScreenImage getSub​(Rectangle sub)
    • 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)
    • equals

      public boolean equals​(Object other)
      Overrides:
      equals in class Object