Results 1 to 5 of 5
Thread: getRGB
- 09-17-2009, 10:40 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 4
- Rep Power
- 0
getRGB
Hello everyone.
I have been trying to find whatdoes whenJava Code:(clr & 0x00ff0000) >> 16
I know from Java Tutorials that getRGB "Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace", that "The bitwise & operator performs a bitwise AND operation" and that ">>" shifts a bit pattern to the right, but what exactly does this whole thing do in simple words? How does it return 255 which is the value of "R" ?Java Code:int clr = image.getRGB(x,y)
Any help would be valuable and appreciated...
I am strugling to find an answer on this...
Thank you.
- 09-17-2009, 11:06 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Do you know what 0x00ff0000 is?
- 09-17-2009, 11:09 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 4
- Rep Power
- 0
is it a hexadecimal address or something?
- 09-17-2009, 11:14 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Okay, so you say "The bitwise & operator performs a bitwise AND operation". Do you know what that means? Likewise with the shift?
If not, google out a few tutorials about "bitwise operators", regardless of the language, and read up on them.
- 09-17-2009, 11:23 AM #5
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
Image class (getRGB)
By shaungoater in forum New To JavaReplies: 1Last Post: 03-07-2008, 09:47 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks