Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to Change color content of an image
How to Change color content of an image [message #453919] Wed, 13 April 2005 22:08 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:OT: How to fire an action and listen in another class
Next Topic:Perspective specific menu
Goto Forum:
  


Current Time: Thu Apr 18 16:23:38 GMT 2024

Powered by FUDForum. Page generated in 0.02092 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top