Filtering on the zoomable image tag.

Started by Calin Leafshade, Tue 05/02/2013 21:38:35

Previous topic - Next topic

Calin Leafshade

Since the zoomable image tag is exclusively used for pixel art it might be a good idea to use css attribs which make the image resize with a nearest neighbour algorithm.

AGA

It uses this plugin.  If you want to work out how to make it do that, then by all means let me know how and I'll implement it.

Calin Leafshade

in modification2.xml change the function below:

Code: javascript

function setZoomLevel(obj, lvl)
{
	obj = obj.parentNode.parentNode;
	img = new Image();
	realImg = obj.getElementsByTagName("img")[0];
	img.src = realImg.src;
	realImg.width = img.width * lvl;
	realImg.height = img.height * lvl;
	obj.style.width = realImg.width + "px";
	obj.style.cssText += "image-rendering: -moz-crisp-edges; -ms-interpolation-mode: nearest-neighbor;";
}


untested but that should work.

AGA


SMF spam blocked by CleanTalk