G
Guest
The .NET class libary presents this as an example of GraphicsPath.IsVisible:
Public Sub IsVisibleExample(ByVal e As PaintEventArgs)
Dim myPath As New GraphicsPath
myPath.AddEllipse(0, 0, 100, 100)
Dim visible As Boolean = myPath.IsVisible(50, 50, e.Graphics)
MessageBox.Show(visible.ToString())
End Sub
This seems to work quite well, it pops up a box that is true, as it should
be. However, if you alter the code:
Public Sub IsVisibleExample(ByVal e As PaintEventArgs)
Dim myPath As New GraphicsPath
myPath.AddEllipse(0.0, 0.0, 1.0, 1.0)
Dim visible As Boolean = myPath.IsVisible(0.5, 0.5, e.Graphics)
MessageBox.Show(visible.ToString())
End Sub
To use those floating points on a smaller scale, the returned value is
false. Now, obviously, that point is within the bounds of the ellipse, and
method explicitly takes Singles, it's not doing a conversion here or anything.
Does anyone know what the reason for this discrepancy is?
Public Sub IsVisibleExample(ByVal e As PaintEventArgs)
Dim myPath As New GraphicsPath
myPath.AddEllipse(0, 0, 100, 100)
Dim visible As Boolean = myPath.IsVisible(50, 50, e.Graphics)
MessageBox.Show(visible.ToString())
End Sub
This seems to work quite well, it pops up a box that is true, as it should
be. However, if you alter the code:
Public Sub IsVisibleExample(ByVal e As PaintEventArgs)
Dim myPath As New GraphicsPath
myPath.AddEllipse(0.0, 0.0, 1.0, 1.0)
Dim visible As Boolean = myPath.IsVisible(0.5, 0.5, e.Graphics)
MessageBox.Show(visible.ToString())
End Sub
To use those floating points on a smaller scale, the returned value is
false. Now, obviously, that point is within the bounds of the ellipse, and
method explicitly takes Singles, it's not doing a conversion here or anything.
Does anyone know what the reason for this discrepancy is?