How to Change color content of an image [message #453919] |
Wed, 13 April 2005 22:08 |
Eclipse User |
|
|
|
Originally posted by: aaa.domain.invalid
Hi,
How do I change the color inside images e.g. change all blue pixels to
say red?
Do I need to be aware of the file format before I do this?
-Chhil
|
|
|
Re: How to Change color content of an image [message #453930 is a reply to message #453919] |
Thu, 14 April 2005 06:02 |
Eclipse User |
|
|
|
Originally posted by: aaa.domain.invalid
Hello,
From Taking a look at SWT Images articles on the eclipse web site.
I was referring to the Manipulating ImageData section where the
colors on a image are manipulated.
I do a similar thing on my black and white image of a black arrow "->"
to reverse the colors on the image but I alway get a completely black
rectangular image.
This is the code snippet to change the color...
if (r < 128 && b < 128 && g < 128)
{
img_data.setPixel(x,y,0xFFFFFF);
}
else
{
img_data.setPixel(x,y,0x000000);
}
Why am I not getting a reverse video effect on my image?
-Chhil
|
|
|
Powered by
FUDForum. Page generated in 0.02092 seconds