Returns

Comments

This utility function is used when creating custom annotation objects. It can be used to calculate the horizontal, vertical, or 45 degree component of a rotated annotation object. It can also be used to easily restrict the mouse cursor on rotated annotation objects.

As an example, consider a rectangle that is rotated 35 degrees in the clockwise direction.

The user has clicked on the Anchor point, and moved the mouse to the Move point.

To find the horizontal component of the line that goes from (Anchor, Move), make the following call, and the ptMove point is adjusted to contain only the horizontal component.

Example

This is part of the custom annotations demo (from example1.c).
This handler gets called when there is a mouse move message on a user handle.
There are four user handles that are processed differently. The
HANDLE_ID_VERTICAL_LEFT and
HANDLE_ID_VERTICAL_RIGHT handles
restrict the mouse cursor to a line parallel to the top of the rectangle,
even if the rectangle is rotated. The
HANDLE_ID_HORIZONTAL_BOTTOM handle
restricts the mouse cursor to a line parallel to the side of the rectangle,
even if the rectangle is rotated. The
HANDLE_ID_HORIZONTAL_TOP handle
rotates the rectangle around the bottom handle (HANDLE_ID_HORIZONTAL_BOTTOM).