javascript - Populate HTML CANVAS with local device file -


I'm building an HTML5 app for Android using Intel XDK.

I am based on myself

  this.dirEntry.getFile (imagePath, {}, function (file entry) {fileEntry. File (function (file) {console.log ("Loading" + file.fullPath + "to canvas"); var ctx = Container GetContext ('2d'); var img = new image (); var url = Window.URL} window.webkitURL; var src = url.createObjectURL (file); img.onload = function () {ctx.drawImage (img, 0, 0); url.revokeObjectURL (src);} img.src = src ;});}, Function (evt) {console.log (evt);});  

When I test with IntelXDK and Veeran, I get:

  Loading file: /// storage / emulate / 0 / Android / Data / Com Intel.html5tools.apppreview / cache / repositories / 00001 / summary.jpg processMessage failed to canvas: error: writing error: type error processMessage failed: pile: writing error: type error on load (file: /// data /data/com.intel .html5tools.apppreview / files / appmobicache / nE5zi-ycD6TAzOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo / 4.0.0 / js / app.js: 248: 27) file: ///data/data/com.intel.html5tools.apppreview / files / appmobicache / nE5zi -ycD6TAzOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo / 4.0.0 / js / app.js: 271: 21 win (file: ///android_asset/www/plugins/org.apache.cordova.file/www/FileEntry.js: 71: 9) .cordova.callbackFromNative on file (file: ///data/data/com.intel.html5tools.apppreview/files/appmobicache/nE5zi-ycD6TA ZOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo / 4.0.0 / cordova.js: 292: 54) processMessage (on file: /// data / data / com.intel.html5tools.apppreview / files / appmobicache / nE5zi-ycD6TAzOFeh0Y3aXzMHLix6 SA22cSUzZ6e3lo / 4.0.0 / cordova.js : 1039: 21) on the function. Android XAC Processes message (file: ///data/data/com.intel.html5tools.apppreview/files/appmobicache/nE5zi-ycD6TAzOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo/4.0.0/ Cordova.js: 1076: 13) once the voting (file: /// data / data / com.intel.html5tools.apppreview / files / appmobicache / nE5zi-ycD6TAzOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo / 4.0.0 / cordova.js: 944: 17) Ofrfonlainivent (file polling: ///data/data/com.intel.html5tools .apppreview / files / appmobicache / nE5zi-ycD6TAzOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo / 4.0.0 / cordova.js: 939: 5) process failed message: message: S -101 file 1 9 874 092 051 { "last modified date": 1413544852000, "fullpath": " File: \ / \ / \ / storage / copying \ / 0 \ / Android \ / data \ / com.intel.html5tools.apppreview \ / cache \ "/ Jpeg", "name": "summary.jpg", "size": 91,793}  

(go to \ / 00001 \ / summary. Thus I test directly with the application when created and deployed on the device) (and also the use of Veeran), I am getting: [object object] to load object processMessage failed: Error: type error: Failed to execute 'createObjectURL' on 'URL': No function found which matched the provided signature. Process message failed: Stack: Type error: Failed to execute 'createObjectURL' on 'URL': No function found which matched the provided signature. On the writing error on the file (native) (file: ///android_asset/www/js/app.js: 248: 27) on file: ///android_asset/www/js/app.js: 271: 21 on Win File: ///android_asset/www/plugins/org.apache.cordova.file/www/FileEntry.js: 72: 9) on Object.cordova.callbackFromNative (file: ///android_asset/www/cordova.js: 292 : 54) at processMessage (file: ///android_asset/www/cordova.js: 1039: 21) Function.androidExec.processMessages (on file: ///android_asset/www/cordova.js: 1076: 13) at pollOnce ( file: ///android_asset/www/cordova.js: 944: 17) on pollOnceFromOnlineEvent (file: ///android_asset/www/cordova.js: 939: 5) processMessage failed: message: S01 File1409319454 { "lastModifiedDate": 1413530713000, "fullpath": "\ / treasury / 00001 \ /summary.jpg", "type": "image \ / jpeg", "name": "summary.jpg", "come Doors ": 91,793}

What's wrong?


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -