Thanks Mr.Boops and Mrdday9 for your valuable reply. I have attached the code I tried. But even when my code points to coordinates inside the circle I am getting reply as false. Can anybody please tell me what could be wrong in the code.
Regards,
Susheelss
Code:Imports System Imports System.Drawing Imports System.Drawing.Drawing2D Public Class Form1 Private CirclePath As GraphicsPath = New GraphicsPath Private _Color As Color Private _Pen As Pen Dim mp As New Point Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Me._Color = Color.Red Me._Pen = New Pen(Me._Color, 6) End Sub Private Sub Form1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove mp = New Point(e.X, e.Y) Label2.Text = e.X & "," & e.Y Select Case e.Button Case Windows.Forms.MouseButtons.Left If CirclePath.IsVisible(mp.X, mp.Y) = True Then Label1.Text = "True" ElseIf CirclePath.IsVisible(mp.X, mp.Y) = False Then Label1.Text = "False" End If End Select End Sub Private Sub Form1_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint CirclePath.AddEllipse(200, 400, 200, 200) e.Graphics.DrawPath(_Pen, CirclePath) End Sub End Class




Reply With Quote