GetPixel into RGB
-
-
Ive been using SetPixel alot, where i feed it seperate R G B values, but now im playing with GetPixel, but it only seems to return one big bitwise value, so how can i most cpu friendly wise convert this big number into 3 sperate ints? thanks
/Johannes
Johpoke wrote:
so how can i most cpu friendly wise convert this big number into 3 sperate ints?
Why not just use
GetRValue()
,GetGValue()
, andGetBValue()
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Johpoke wrote:
so how can i most cpu friendly wise convert this big number into 3 sperate ints?
Why not just use
GetRValue()
,GetGValue()
, andGetBValue()
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
That sounds right, but how do i connect them or use them correctly? i just get out weird characters, no numbers.. :/
/Johannes
Johpoke wrote:
...but how do i connect them...
Huh?
Johpoke wrote:
i just get out weird characters, no numbers..
How are you using those functions?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Johpoke wrote:
...but how do i connect them...
Huh?
Johpoke wrote:
i just get out weird characters, no numbers..
How are you using those functions?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
im not sure if im using them correctlt, msdn didnt explain alot, first i tried geting pixel, and sening the int to getrbvale, i also tried some other data types, and last i tied: cout</Johannes
Johpoke wrote:
cout< This is doing exactly what it is supposed to (i.e., printing the character equivalent of the red value). Since your red value is likely not a printable character (e.g., some value less than 33 or greater than 127), that's why you're not seeing a number. Cast it to an
int
instead.Johpoke wrote:
how do i get the Rvalue G and B for the pixel seperate??
By using the three functions I mentioned earlier.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Johpoke wrote:
cout< This is doing exactly what it is supposed to (i.e., printing the character equivalent of the red value). Since your red value is likely not a printable character (e.g., some value less than 33 or greater than 127), that's why you're not seeing a number. Cast it to an
int
instead.Johpoke wrote:
how do i get the Rvalue G and B for the pixel seperate??
By using the three functions I mentioned earlier.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb