I can use the javascript to get the image data from html:
function imageClicked(e) {
//alert(this.getAttribute("src"));
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
canvas.width = this.width;
canvas.height = this.height;
context.drawImage(this,0,0,this.width,this.height);
loadURL(canvas.toDataURL("image/png"));
e.stopPropagation(); // <=== Prevents the click reaching the div
}
But the image does not as clear as it shows in html ,it is compressed. How to get the image not being compressed?
The raw image showed in UIWebView is below, we can see the words in the image is very clear:
The Next picture is got from the javascript and then shows it,it is not very clear: