CODRulerComponent::OnDraw

voidCODRulerComponent::OnDraw(CDC*pDC)

Draws the ruler component onto a device context.

Defined in: OdRulerComp.cpp

Return Value

void

Parameters

pDC

The device context to draw in.

Comments

The interface pointer to  IODRuler determines the unit of measurement for the ruler. It is also used to convert from measurements into logical units. Drawing of hash marks and numbers is divided into 7 levels of detail. The spacing or increment between each level of detail is determined by the unit of measure. For metric units, levels of detail are always divided by increments of 10. For english units, the increment can vary depending on the unit of measure.

The properties OD_PROP_LOWER_DETAIL_THRESHOLD and OD_PROP_UPPER_DETAIL_THRESHOLD are used to determine if a given level of detail should be drawn. These properties indicate the minimum and maximum values in pixels for a given level of detail. For example, the sixth level of detail for inches is 1/8 of an inch. If an 1/8 of an inch maps less than the number of pixels specified by the OD_PROP_LOWER_DETAIL_THRESHOLD, then the sixth level of detail will not be drawn.