AEngine.Image = function(url) {
var xhr = new XMLHttpRequest();
xhr.open("GET",directory,0);
xhr.overrideMimeType("text/plain; charset=x-user-defined");
xhr.send();
var response = xhr.responseText;
var buffer = new Uint8Array(response.length);
for (var i=0; i < buffer.length; i++)
buffer[i] = response.charCodeAt(i);
var blob = new Blob([buffer], {"type":"image/jpeg"});
var img = document.createElement("img");
img.src = window.URL.createObjectURL(blob);
return img;
}
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss
The image is not ready until image.onload has been called. So it reports invalid image. I think you should upload your image to texture in the image.onload callback. Hope it helps.
Regards,
Jin