|
-
Jul 30th, 2001, 08:19 AM
#1
Thread Starter
Lively Member
Aquiring color of a pixel
I very typical problem. When I have a file saved in a picture box, how can I aquire R (red) G(green) B(blue) of a pixel that have a coodinate of X and Y ?
Thank ya
What are the universe used for and why it's here ?
-
Jul 30th, 2001, 08:33 AM
#2
Frenzied Member
Have a look at the Point method;
(from the help file)
Point Method
Returns, as a long integer, the red-green-blue (RGB) color of the specified point on a Form or PictureBox. Doesn't support named arguments.
Syntax
object.Point(x, y)
The Point method syntax has these parts:
Part Description
object Optional. An object expression that evaluates to an object in the Applies To list. If object is omitted, the Form object with the focus is assumed to be object.
x, y Required. Single-precision values indicating the horizontal (x-axis) and vertical (y-axis) coordinates of the point in the ScaleMode property of the Form or PictureBox. Parentheses must enclose the values.
Remarks
If the point referred to by the x and y coordinates is outside object, the Point method returns -1.
--------------------------------------------------------------------------------
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jul 30th, 2001, 08:35 AM
#3
Member
-
Jul 30th, 2001, 08:35 AM
#4
Thread Starter
Lively Member
YEAH !
I really don't know how to thank ya ...
What are the universe used for and why it's here ?
-
Jul 30th, 2001, 08:36 AM
#5
Member
How about your life savings?
-
Jul 30th, 2001, 08:38 AM
#6
Thread Starter
Lively Member
life saving ...
I don't mind as it is a negetive number ....
What are the universe used for and why it's here ?
-
Jul 30th, 2001, 08:39 AM
#7
-
Jul 30th, 2001, 08:54 AM
#8
Retired VBF Adm1nistrator
If speed, or quality of code is an issue, then I would use the GetPixel() API instead.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 30th, 2001, 09:10 AM
#9
Member
Originally posted by plenderj
If speed, or quality of code is an issue, then I would use the GetPixel() API instead.
And if you end up using a control other than the PictureBox.
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
|