/** * FOR INTERNAL USE: from IDE - suppresses load error message * * @param fName image filename * @return this */ public static Image createThumbNail(String fName) { Image img = get(fName, true); return createImageValidate(img, false); }
/** * create a new image from a filename <br> * file ending .png is added if missing (currently valid: png, jpg, jpeg)<br> * relative filename: [...path.../]name[.png] is searched on current image path<br> * absolute filename is taken as is * if image exists, it is loaded to cache <br> * already loaded image with same name (given path) is reused (taken from cache) <br> * * if image not found, it might be a text to be searched (imageIsText = true) * * @param fName image filename * @return an Image object (might not be valid - check with isValid()) */ public static Image create(String fName) { Image img = get(fName, false); return createImageValidate(img, true); }
protected static <PSI> Image getImageFromTarget(PSI target) { if (target instanceof Pattern) { return ((Pattern) target).getImage(); } else if (target instanceof String) { Image img = get((String) target, true); img = createImageValidate(img, true); return img; } else if (target instanceof Image) { return (Image) target; } else { runTime.abortScripting("aborting script at:", String.format("find, wait, exists: invalid parameter: %s", target)); } return null; }
/** * create a new image from the given url <br> * file ending .png is added if missing <br> * filename: ...url-path.../name[.png] is loaded from the url and and cached * <br> * already loaded image with same url is reused (reference) and taken from * cache * * @param url image file URL * @return the image */ public static Image create(URL url) { Image img = get(url); if (img == null) { img = new Image(url); } return createImageValidate(img, true); }