/// <summary> /// </summary> /// <param name="canvas"></param> /// <param name="url"> /// </param> /// <param name="onload"> /// </param> /// <param name="onerror"> /// </param> /// <param name="database"> /// </param> /// <returns> /// </returns> /// <exception cref="NotImplementedException"> /// </exception> public static HTMLImageElement LoadImage(HTMLCanvasElement canvas, string url, Action <ImageData> onload, Action <ImageData, object> onerror, object database) { canvas.loadImage(url, onload, onerror); return(null); /* * url = Tools.CleanUrl(url); * var img = new Image(); * img.crossOrigin = "anonymous"; * img.onload = () => { * onload(img); * }; * img.onerror = (err) => { * onerror(img, err); * }; * var noIndexedDB = () => { * img.src = url; * }; * var loadFromIndexedDB = () => { * database.loadImageFromDB(url, img); * }; * if (database && database.enableTexturesOffline && BABYLON.Database.isUASupportingBlobStorage) { * database.openAsync(loadFromIndexedDB, noIndexedDB); * } else { * if (url.IndexOf("file:") == -1) { * noIndexedDB(); * } else { * try { * var textureName = url.Substring(5); * var blobURL; * try { * blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesTextures[textureName], new {}); * } catch (Exception ex) { * blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesTextures[textureName]); * } * img.src = blobURL; * } catch (Exception e) { * Tools.Log("Error while trying to load texture: " + textureName); * img.src = null; * } * } * } * return img; */ }