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
Comments
Post a Comment