Jump to content
Sign in to follow this  

GDI CreateElliptic

Recommended Posts


So I've got an image that is a circle and I want to be able to detect when the inside of the circle is clicked. I've used


If _WinAPI_PtInRectEx($aPos[0], $aPos[1], $TargetX + 5, $TargetY + 30, $TargetX + $TargetWidth, _
            $TargetY + $TargetHeight) Then


And that works but since its a circle it won't work. I attempted to use the CreateEllipticRgn using the following but my script crashes instantly.


Dim $Range = [100, 100, 100, 100]



Not sure if I have the structure right (I doubt I do) but if there's an easier method to detect a mouse click within a circle than that would be helpful. Thanks!


Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post

Link to post
Share on other sites


x²+y²=r² so the distance of a point X from the middle of a circle M is 

\overline{\rm XM} = \sqrt{(x-x_M)^2+(y-y_M)^2}.

if XM<r the point is inside the circle...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this