Images: Paint Alternate Pixels?
Images: Paint Alternate Pixels?
RealWorld Graphics logo    
Not logged in.  
IndexSoftwareGraphicsArticlesDiscussMore...

Login/Register
Forum List
Announcements
Icons and Cursors
Images
3D graphics
Win32 C/C++/VB
.NET C#/C++/VB
Tips and tricks
General discussion
User List
Search this site using Google

Windows Vista icons

Find out how Vista icons differ from XP icons.

See how RealWorld Icon Editor handles Vista icons.

I wish there were ...

Back to forum Images

Paint Alternate Pixels?

Is this an option?

2007-05-01Author: <unknown>
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

2007-05-01Author: Vlasta
You are right, this feature is not present in RWIE. You have these options:
1) Use background color, set alpha to 1/2 (12 and use the Paint Over mode (the default one). Then draw any shape or fill an area. This will dim the affected pixels, but the result will be different form Microangelo - the image will be smooth in high color depths, and dithered in low color depths (but there will not be a regular pattern).
2) Create a custom script, that replaces every other pixel with given color. The script would only be able to affect the entire image or the selected area, so no flood-filling and such.

2007-05-02Author: <unknown>
Wow, scripts look like the answer, but I'm not sure I'm up to writing one from scratch!

Could anyone post he code required to do this?

Thanks for your help.

MB

2007-05-02Author: Vlasta

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.



2007-05-03Author: <unknown>
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

2007-05-03Author: Vlasta
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.

2007-05-03Author: <unknown>
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

2007-05-03Author: Vlasta
Actually 0xff0000ff should be red ;-). To erase pixels use just color = 0.


Post Reply

Please login or register before posting.

Message text:


Back to forum Images

Copyright © 2005-2007 RealWorld Graphics. Contact: info@rw-designer.com.