Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problems in BufferedImage.setRGB()

807569May 21 2006 — edited May 21 2006
Hi All,

I am using BufferedImage.setRGB() to set the color of a pixel in the image. I have a function which calculates which color to be given to that pixel and then the hex string like
0x0000ff00
is returned.

I want to use this string in setRGB(). thus i used
buffImage.setRGB(j, i ,Integer.decode(getRGBHexString(pixelVal)).intValue());
to color the pixel .But this is not giving me the desired output.
As the integer value of the hex string is more, the pixel is painted as black.

But if I use the same hexString as below its giving the correct color.
buffImage.setRGB(j, i ,0x00a0a0a0);
Please help me and also tell me if there is any other way to do the same thing.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2006
Added on May 21 2006
2 comments
170 views