Our application loads a PNG-image via javascript and reads it for the 2D reference of the canvas element Draws the exact color value of pixels (using getImageData)
It works well in all browsers supporting Canvas-API except in IE9: ctx.drawImage (img, 0, 0) any type of image anti Is it possible to disable this behavior to implement aliasing? Our code type looks like this:
var img = document.createElement ('IMG'); Img.addEventListener ('Load', function (e) {var w = img.width, h = img.height, ctx = canvas.getContext ('2d'); ctx.drawImage (IMG, 0, 0); var data = Ctx.getImageData (0, 0, w, h), pixel = for datadata; (var y = 0, i = 0; y & lt; h; y ++) {for (var x = 0; x & Lt; w; x ++, i + = 4) {var r = pixel [i], g = pixel [i + 1], b = pixels [i + 2], color = (r & lt; 16) | (G & lt; 8) | b; // something with x, y and color}}}); Img.src = 'images / source.png'; The approach to improving the crunchiness of the lines depends on whether or not you are full or not. See for drawing of each ...
Comments
Post a Comment