I am trying to write an image from the image-lib to harddisk but so far
I cannot write the image to the imagefield.
TIA.
This is my code:
var getpicture = plugins.images.getImage(‘media:///myimage.png’).getData();
if (!getpicture) {plugins.dialogs.showWarningDialog(‘Warning’, Could not store picture’, ‘OK’)}
var fileName = ‘c:/tempfolder/myimage.png’
var success = plugins.file.writeFile(fileName,imagefield);
if (!success) {plugins.dialogs.showWarningDialog(‘Warning’, ‘Could not write file’, ‘OK’)}
You’re absolutely right Patrick, but I accidentely deleted the line:
imagefield=getpicture
Indeed it is more elegant not to use a temporary imagefield but
rather stick to the variable.
Nevertheless I still can’t get the picture () so
there must be something wrong in the first line of code.
I am absolutely sure ‘myimage.png’ is in the lib.
Do you know what it can be?