Image path to load (POSIX path). Supports PNG and JPG files.
Returns the image through Image object.
Loads an image from a File object.
var myFile = new File( 'C:/images/tulips.jpg' );
var myPict = loadImage(myFile);
var newPict = new ds.Pict();
newPict.name = 'Flower';
newPict.photo = myPict;
newPict.save();
File object that reference an image. Supports PNG and JPG files.
Returns the image through Image object.
Loads the content of a text file from its path.
var myText = loadText( 'PROJECT/bootstrap.js' );
console.log(myText);
File path to load (POSIX path).
(default: 7) Defines the charset to use to read the file. See charset values for more details.
Returns a string with the full text file content.
Loads the content of a text file from a File object.
var myFile = new File( 'PROJECT/bootstrap.js' );
var myText = loadText( myFile );
console.log( myText );
File object that reference a text file.
(default: 7) Defines the charset to use to read the file. See charset values for more details.
Returns a string with the full text file content.
Saves the text into a file.
saveText( 'Hello World ! Here is my text saved.', 'C:/texts/chapter-1.txt' );
Text string to save.
File path where to update (POSIX path).
(default: 7) Defines the charset of the text string. See charset values for more details.
Saves the text into a file.
var myFile = new File( 'C:/texts/chapter-1.txt' );
saveText( 'Hello World ! Here is my text saved.', myFile );
Text string to save.
File path where to update (POSIX path).
(default: 7) Defines the charset of the text string. See charset values for more details.
Loads an image from its path.
var myPict = loadImage( 'C:/images/tulips.jpg' ); var newPict = new ds.Pict(); newPict.name = 'Flower'; newPict.photo = myPict; newPict.save();
The Image API is partially supported on Linux platforms: