user iconAnonymous on April 30th 2007
19255 views

topic iconPaint Alternate Pixels?

Is this an option?

I have used Microangelo before, and it had one feature which I cannot find in RealWorld: The option to paint alternate pixels.

You could paint or fill an area and it would only affect the odd or even pixels, alternating on each line.

This means that by filling in background colour you could dim the icon.

Any comparable tool in RealWorld to achieve the same effect?

Thanks

Matt Brown

Show older posts
user iconVlasta 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.

user iconVlasta on May 2nd 2007 0

Oh, there was a problem with html encoding, I forgot to use &lt; instead of < and part of the code was not visible. It should be all right now.

user iconAnonymous 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

user iconAnonymous 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

user iconVlasta on May 2nd 2007 0

Actually 0xff0000ff should be red 😉. To erase pixels use just color = 0.

user iconAnonymous on July 17th 2009 0

oooooooooooo your my pikcur

user iconsixλxis on March 24th 2010 0

it says "expected ')'" when i input it.

please post the updated code.

user iconVlasta on March 24th 2010 0

Fixed...

user iconsixλxis on March 25th 2010 0

Now it says 'RasterImage is undefined'

(im trying to use this in paint)

user iconVlasta 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.

user icon