Saves the image into a file. Append a file extension to the name of the file, to indicate the file format to be used: either TIFF (.tif), TARGA (.tga), JPEG (.jpg), or PNG (.png). If no extension is included in the filename, the image will save in TIFF format and .tif will be added to the name. The
(String filename)
| 3193 | * @param filename a sequence of letters and numbers |
| 3194 | */ |
| 3195 | public boolean save(String filename) { // ignore |
| 3196 | String path; |
| 3197 | |
| 3198 | if (parent != null) { |
| 3199 | // use savePath(), so that the intermediate directories are created |
| 3200 | path = parent.savePath(filename); |
| 3201 | |
| 3202 | } else { |
| 3203 | File file = new File(filename); |
| 3204 | if (file.isAbsolute()) { |
| 3205 | // make sure that the intermediate folders have been created |
| 3206 | PApplet.createPath(file); |
| 3207 | path = file.getAbsolutePath(); |
| 3208 | } else { |
| 3209 | String msg = |
| 3210 | "PImage.save() requires an absolute path. " + |
| 3211 | "Use createImage(), or pass savePath() to save()."; |
| 3212 | PGraphics.showException(msg); |
| 3213 | return false; |
| 3214 | } |
| 3215 | } |
| 3216 | return saveImpl(path); |
| 3217 | } |
| 3218 | |
| 3219 | |
| 3220 | /** |
nothing calls this directly
no test coverage detected