|
-
Mar 20th, 2001, 06:57 PM
#1
Thread Starter
Fanatic Member
I have a color returned from GetPixel, how to i extract the Red, Green, and Blue. Again, i have seen this before, but because search is disabled, i must post again.
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 20th, 2001, 07:09 PM
#2
Lively Member
Here it goes!
Code:
put this in a module:
Public Type MyRGBColor
Red As Byte
Green As Byte
Blue As Byte
End Type
Public Type MyColor
RGB As Long
End Type
Form General declarations!
Dim mycol As MyColor
Dim RGBCol As MyRGBColor
Dim d As Long
Then in a sub:
d = GetPixel ...blah , blah
mycol.RGB = d
LSet RGBCol = mycol
Dim d1
d1 = (RGBCol.Red & "," & RGBCol.Green & "," & RGBCol.Blue)
MsgBox d1
Cheers
-
Mar 20th, 2001, 07:23 PM
#3
Thread Starter
Fanatic Member
that's an interesting way to do it, i was originally looking for the arithmatic way, but this will do just fine, thanks alot!
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 20th, 2001, 08:25 PM
#4
Thread Starter
Fanatic Member
i am getting unpredicable results with this method. does anyone have the arithmatic method. not to put you down, iScanning, but i'm only getting correct results rarely. i'm getting some inverted results and also some completly inaccurate results.
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 20th, 2001, 08:31 PM
#5
Thread Starter
Fanatic Member
oops, my fault, it was a bug in my software, anyway, thanks, your method works fine!
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|