|
-
Nov 15th, 2005, 01:00 AM
#1
Thread Starter
New Member
Point Function
Hi All,
Point function of Form object returns color of the pixel at a
partcular location on the form.
I tried to use this function in a project of Graphics.
I found that the behaviour of the function was strange.
Sometimes, the function returned a color value upon clicking
a pixel on form.
Other times, it simply falied to return anything.
It just kept returning -1 eventhought the color of the pixel was red.
The same code worked on other PCs while on still others it failed.
Can anyone explain why Point function behaves like this ?
I need a quick reply.
Thank you.
-
Nov 15th, 2005, 07:13 PM
#2
Re: Point Function
The Point function normally returns -1 if the coordinates you specify is outside of the Form border. Could you post the code you used?
-
Nov 15th, 2005, 07:19 PM
#3
Re: Point Function
I think it even returns -1 if the mouse cursor is over objects as well. Correct me if I'm wrong but I remember that happening to me in the past.
-
Nov 15th, 2005, 07:22 PM
#4
Re: Point Function
That is true unless the ClipControls property is set to False.
-
Nov 18th, 2005, 01:16 AM
#5
Thread Starter
New Member
Re: Point Function
Hi Jacob,
Here is the code you want.
If you know computer graphics, it is about BoundaryFill Algorithm that fills
a polygon. If you need any further code, just inform me. Thanks.
Public Sub BoundaryFill4(xf As Single, yf As Single, FillCol As ColorConstants, BoundaryCol As ColorConstants)
Dim current As ColorConstants
current = Point(xf, yf)
If ((current <> BoundaryCol) And (current <> FillCol)) Then
Me.PSet (xf, yf), FillCol
Call BoundaryFill4(xf + 1, yf, FillCol, BoundaryCol)
Call BoundaryFill4(xf - 1, yf, FillCol, BoundaryCol)
Call BoundaryFill4(xf, yf + 1, FillCol, BoundaryCol)
Call BoundaryFill4(xf, yf - 1, FillCol, BoundaryCol)
End If
-
Nov 18th, 2005, 01:20 AM
#6
Re: Point Function
Does that solve your problem?
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
|