Saturday, September 11, 2004


Hit Testing for Lines and Curves

Win32: Hit Testing Lines and Curves
Dennis Crain
Microsoft Developer Network Technology Group

Created: February 8, 1994

"What Is Hit Testing?
To the user, the act of hit testing in a graphical user interface seems natural. The pointing device's cursor is placed over an object, and the user initiates an action to "hit" the object. Most often this pointing device is a mouse, and the action is a mouse click.

Within the context of this article, let's agree that hit testing is the process of determining if the user has selected a line or a curve by means of a mouse click. I will describe three methods for selecting these objects. Two methods are general in that they do not rely on any of the functionality of Win32. The third method combines the line hit-testing method with a new feature of Win32, paths.

Many programmers know hit testing as "picking," the term used in many textbooks on graphics and in many graphics languages. For example, you pick a line segment on the screen and move it to another location."

Connectors and Cables
Dennis Crain
Microsoft Developer Network Technology Group

May 1995


GDI+ Line/Curve Drawing and Hit Test
By Husni Che Ngah

Demo application for developing a drawing application using GDI+. Featuring line/curve draw, hit test, and implementation of CObject/CObArray classes.

Graph Marker with Hit-Testing
By Wenfei Wu February 11, 1999

<< Home

This page is powered by Blogger. Isn't yours?