user iconmb on August 4th 2008
1500 views

topic iconCustomer Operation

The custom operation in the Effect menu has stopped working. The syntax checks OK, but clicking OK does nothing!
The exact contents of the box is below. This (I believe) is the default operation to paint every other pixel with Transparent.

Any ideas?
Thanks

var sizeX = RasterImage.sizeX;
var sizeY = RasterImage.sizeY;
var color = 0x00000000;
for(x=0; x<sizeX; x  )
  for(y=0; y<sizeY; y  )
    if ((x y)&1)
      RasterImage.SetPixel(x, y, 0, 0, 0);
user iconVlasta on August 4th 2008 0

What application and what version are you using? The script interface differs a bit in latest icon editor. If that is the case, it should look like this:

var image = Document.RasterImage;
var sizeX = image.sizeX;
var sizeY = image.sizeY;
for (x=0; x<sizeX; x  )
	for (y=0; y<sizeY; y  )
		if ((x y)&1)
			image.SetPixel(x, y, 0, 0, 0);

Here is documentation for scripting in latest version: wiki/Scripting

user icon