It's not quite so simple with C#.
First you need a GraphicsPath
. Then initialise it which the shape that you want, for an ellipse use the method AddEllipse
. Then use the IsVisible
method to check if your point is contained within the shape. You can test for arbitrary shapes by using one of the various AddLine
methods.
eg.
Rectangle myEllipse = new Rectangle(20, 20, 100, 50);
// use the bounding box of your ellipse instead
GraphicsPath myPath = new GraphicsPath();
myPath.AddEllipse(myEllipse);
bool pointWithinEllipse = myPath.IsVisible(40,30);