<< Return to Main Index

< Return to Class Index

GXDrawRotatedText

int GXDrawRotatedText(CDC* pDC, LPCTSTR lpszString, int nCount, CRect rect, UINT nFormat, LONG lfOrientation, LPRECT lpRectClip = NULL);

pDC

Points to the device context.

lpszString

Points to the text to be drawn.

nCount

Specifies the size of the text in bytes. You should pass -1 for a zero-terminated string.

rect

Drawing rectangle.

nFormat

DT_WORBREAKword break

lfOrientation

Specifies the angle of the text to be drawn in tenth of degrees. This value should be the same value as lf.lfOrientation for the font that has been selected into the device context.

lpRectClip

Specifies an optional clipping rectangle for the text. It may be NULL if the clipping area is the same as the drawing rectangle. The clipping rectangle must not be smaller than the drawing rectangle. Otherwise, the function will assert. The main purpose of this optional attribute is to let the function draw a right-most character even when it is outside the drawing rectangle.

Return Value

Unused. Always 0.

Remarks

This methods lets you draw rotated single-line text. Any angle between 0 and 360 degrees is supported.

You should pass the lf.lfOrientation value of the font that is selected into the device context to the lfOrientation attribute. If you pass a different value the output will not be rotated correctly,

Control-Factory Specific ->

This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the CGXDrawingAndFormatting::ImplementDrawRotatedText method from within the control factory class' InitializeApplicationComponents method will make the concrete implementation of this method available to your application.

If no concrete implementation is available this method returns 0. A warning will be displayed in the debug window.

END Control-Factory Specific

See Also

CGXDrawingAndFormatting

Macros

Class Overview | Class Members