Vlasta
on May 1st 2007
0
The simples way to run a custom script is to click on "Custom Operation" in the "Effect" menu and replace the script with the following one:
var sizeX = RasterImage.sizeX;
var sizeY = RasterImage.sizeY;
var color = 0xff0000ff;
for(x=0; x<sizeX; x++)
for(y=0; y<sizeY; y++)
if ((x+y)&1)
RasterImage.SetPixel(x, y, 0, 0, color);
Note the color variable on 3rd line. By changing it, you may select different color. The color is in hexadecimal ABGR encoding, if you are not sure what that means, use the following line, but with actual color values (in range 0-255):
var color = (ALPHA<<24)|(BLUE<<16)|(GREEN<<8)|(RED);
There are other ways how to define and run scripts, but this is the easiest one.
Vlasta
on May 2nd 2007
0
Oh, there was a problem with html encoding, I forgot to use < instead of < and part of the code was not visible. It should be all right now.
Anonymous
on May 2nd 2007
0
Thanks for that.
I can follow the code and kind of see what it does. However, the syntax is incomplete. If anyone could alter the code ({ } and correct number of brackets etc) I would very much appreciate it.
Thanks all.
MB
Anonymous
on May 2nd 2007
0
THANKS VLASTA!!!
You are a star.
The colour code for transparent background, var color = 0xff0000ff;, achieves exactly what I wanted!
This creates a dimmed icon for any coloured backdrop.
Thanks for all you help.
Best Regards,
MB
Vlasta
on May 2nd 2007
0
Actually 0xff0000ff should be red 😉. To erase pixels use just color = 0.
Anonymous
on July 17th 2009
0
oooooooooooo your my pikcur
it says "expected ')'" when i input it.
please post the updated code.
Now it says 'RasterImage is undefined'
(im trying to use this in paint)
Vlasta
on March 25th 2010
0
It will only work with a older versions of the apps. In newer ones, Document.RasterImage must be used instead of just RasterImage
There is an updated version in another topic.