Back | Reverse | Quick Reply | Post Reply |

[Need help] Hex in java
Link | by Atsuku(binku) on 12:46:31 am 10/25/09
return (rgb & 0xff00ffff) <--- return type is int
I found this : Integer.toHexString(int);
I try to (rgb & Integer.toHexString(int)) but it won't 'and' String value.
I need to do manipulating image.
Dareka.. tasukete... >_<

Re: [Need help] Hex in java
Link | by gendou on 03:28:58 pm 10/25/09 (edited 03:30:02 pm 10/25/09)
Integer.toHexString() returns a string.
You can't perform the mathematical AND operation on a string!
What are you trying to do, actually?
If you want readable hex of just the one color channel:

return Integer.toHexString(rgb & 0xFF00FFFF);


Re: [Need help] Hex in java
Link | by Atsuku(binku) on 02:28:28 am 10/28/09
Actually, i want to edit each pixel's RGB value. So something like, i took one pixel in some coordinate, i get the RGB value of it, and then increase/decrease the value of green for example(ex. found green's value = a3, increase it to max = ff or dd, (i use JSlider for each RGB, and alpha too). And then return it to appropriate method for image filtering. Sore de. ^^

Re: [Need help] Hex in java
Link | by gendou on 02:40:19 am 10/28/09
You will want to use the class PixelGrabber.


Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2012 Gendou | Terms of Use | Page loaded in 0.0054 seconds at 09:52:56 pm 02/09/12